|
43 | 43 | Hash $inputs = {},
|
44 | 44 | ) {
|
45 | 45 |
|
46 |
| - include splunk::params |
47 |
| - |
48 | 46 | if defined(Class['splunk::forwarder']) {
|
49 | 47 | $mode = 'forwarder'
|
50 | 48 | } else {
|
|
53 | 51 |
|
54 | 52 | if $splunk_home {
|
55 | 53 | $_splunk_home = $splunk_home
|
56 |
| - } |
57 |
| - else { |
| 54 | + } else { |
58 | 55 | case $mode {
|
59 | 56 | 'forwarder': { $_splunk_home = $splunk::params::forwarder_homedir }
|
60 | 57 | 'enterprise': { $_splunk_home = $splunk::params::enterprise_homedir }
|
|
84 | 81 |
|
85 | 82 | file { "${_splunk_home}/etc/apps/${name}/local": ensure => directory }
|
86 | 83 |
|
87 |
| - unless $inputs.empty { |
88 |
| - $inputs.each |$section, $attributes| { |
89 |
| - $attributes.each |$setting, $value| { |
90 |
| - case $mode { |
91 |
| - 'forwarder': { |
92 |
| - splunkforwarder_input { "${name}_${section}_${setting}": |
93 |
| - section => $section, |
94 |
| - setting => $setting, |
95 |
| - value => $value, |
96 |
| - context => "apps/${name}/local", |
97 |
| - require => File["${_splunk_home}/etc/apps/${name}/local"], |
98 |
| - } |
| 84 | + $inputs.each |$section, $attributes| { |
| 85 | + $attributes.each |$setting, $value| { |
| 86 | + case $mode { |
| 87 | + 'forwarder': { |
| 88 | + splunkforwarder_input { "${name}_${section}_${setting}": |
| 89 | + section => $section, |
| 90 | + setting => $setting, |
| 91 | + value => $value, |
| 92 | + context => "apps/${name}/local", |
| 93 | + require => File["${_splunk_home}/etc/apps/${name}/local"], |
99 | 94 | }
|
100 |
| - 'enterprise': { |
101 |
| - splunk_input { "${name}_${section}_${setting}": |
102 |
| - section => $section, |
103 |
| - setting => $setting, |
104 |
| - value => $value, |
105 |
| - context => "apps/${name}/local", |
106 |
| - require => File["${_splunk_home}/etc/apps/${name}/local"], |
107 |
| - } |
| 95 | + } |
| 96 | + 'enterprise': { |
| 97 | + splunk_input { "${name}_${section}_${setting}": |
| 98 | + section => $section, |
| 99 | + setting => $setting, |
| 100 | + value => $value, |
| 101 | + context => "apps/${name}/local", |
| 102 | + require => File["${_splunk_home}/etc/apps/${name}/local"], |
108 | 103 | }
|
109 |
| - default: { fail('Instances of Splunk::Addon require the declaration of one of either Class[splunk::enterprise] or Class[splunk::forwarder]') } |
110 | 104 | }
|
| 105 | + default: { fail('Instances of Splunk::Addon require the declaration of one of either Class[splunk::enterprise] or Class[splunk::forwarder]') } |
111 | 106 | }
|
112 | 107 | }
|
113 | 108 | }
|
|
0 commit comments