|
1 | 1 | class splunk::linux_forwarder {
|
| 2 | + |
| 3 | + $server = $splunk::params::logging_server |
| 4 | + $port = $splunk::params::logging_port |
| 5 | + |
2 | 6 | file {"${splunk::params::linux_stage_dir}":
|
3 | 7 | ensure => directory,
|
4 | 8 | owner => "root",
|
|
18 | 22 | },
|
19 | 23 | notify => Exec['start_splunk'],
|
20 | 24 | }
|
21 |
| -# firewall { "100 allow Splunkd": |
22 |
| -# action => "accept", |
23 |
| -# proto => "tcp", |
24 |
| -# dport => "${splunk::params::splunkd_port}", |
25 |
| -# } |
| 25 | + |
26 | 26 | exec {"start_splunk":
|
27 | 27 | creates => "/opt/splunkforwarder/etc/licenses",
|
28 | 28 | command => "/opt/splunkforwarder/bin/splunk start --accept-license",
|
29 | 29 | timeout => 0,
|
30 | 30 | }
|
31 |
| - exec {"set_forwarder_port": |
32 |
| - unless => "/bin/grep \"server \= ${splunk::params::logging_server}:${splunk::params::logging_port}\" /opt/splunkforwarder/etc/system/local/outputs.conf", |
33 |
| - command => "/opt/splunkforwarder/bin/splunk add forward-server ${splunk::params::logging_server}:${splunk::params::logging_port} -auth ${splunk::params::splunk_admin}:${splunk::params::splunk_admin_pass}", |
34 |
| - require => Exec['set_monitor_default'], |
35 |
| - notify => Service['splunk'], |
36 |
| - } |
37 | 31 | exec {"set_monitor_default":
|
38 | 32 | unless => "/bin/grep \"\/var\/log\" /opt/splunkforwarder/etc/apps/search/local/inputs.conf",
|
39 | 33 | command => "/opt/splunkforwarder/bin/splunk add monitor \"/var/log/\" -auth ${splunk::params::splunk_admin}:${splunk::params::splunk_admin_pass}",
|
|
55 | 49 | hasrestart => true,
|
56 | 50 | require => File['/etc/init.d/splunk'],
|
57 | 51 | }
|
| 52 | + |
| 53 | + file { '/opt/splunkforwarder/etc/system/local/outputs.conf': |
| 54 | + ensure => file, |
| 55 | + content => template('splunk/outputs.conf.erb'), |
| 56 | + require => Package['splunkforwarder'], |
| 57 | + notify => Service['splunk'], |
| 58 | + } |
58 | 59 | }
|
0 commit comments