Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 class nagios::server( | 1 class nagios::server( |
2 $directory = hiera('nagios::server::directory', '/var/lib/nagios3'), | |
mathias
2017/10/25 16:53:42
This technique is not necessary any more, we've be
f.nicolaisen
2017/10/26 07:45:04
Noted for next time!
| |
2 $domain, | 3 $domain, |
3 $certificate, | 4 $certificate, |
4 $private_key, | 5 $private_key, |
5 $is_default=false, | 6 $is_default=false, |
6 $htpasswd_source, | 7 $htpasswd_source, |
7 $admins, | 8 $admins, |
8 $zone, | 9 $zone, |
9 $contacts = hiera('nagios::server::contacts', {}), | 10 $contacts = hiera('nagios::server::contacts', {}), |
10 $contactgroups = hiera('nagios::server::contactgroups', {}), | 11 $contactgroups = hiera('nagios::server::contactgroups', {}), |
11 $commands = hiera('nagios::server::commands', {}), | 12 $commands = hiera('nagios::server::commands', {}), |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 } | 45 } |
45 | 46 |
46 spawn_fcgi::php_pool {'global': | 47 spawn_fcgi::php_pool {'global': |
47 ensure => present, | 48 ensure => present, |
48 socket => '/tmp/php-fastcgi.sock', | 49 socket => '/tmp/php-fastcgi.sock', |
49 children => '3', | 50 children => '3', |
50 require => Package['php5-cgi'] | 51 require => Package['php5-cgi'] |
51 } | 52 } |
52 | 53 |
53 # See http://hub.eyeo.com/issues/4612#note-2 | 54 # See http://hub.eyeo.com/issues/4612#note-2 |
54 if $::operatingsystem == 'Debian' { | 55 if $::osfamily == 'Debian' { |
55 exec {'override-nagios-dpkg-stats': | 56 |
56 command => 'dpkg-statoverride --update --add nagios www-data 2710 /var/lib /nagios3/rw && dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagio s3', | 57 $dpkg_statoverride = 'dpkg-statoverride' |
mathias
2017/10/25 10:31:47
Please use shellquote() to aggregate the $command
f.nicolaisen
2017/10/25 14:36:09
Acknowledged.
| |
57 unless => 'dpkg-statoverride --list nagios www-data 2710 /var/lib/nagios3/ rw && dpkg-statoverride --list nagios nagios 751 /var/lib/nagios3', | 58 $dpkg_options = shellquote(['nagios', 'nagios', '751', "$directory"]) |
59 $dpkg_options_rw = shellquote(['nagios', 'www-data', '2710', "$directory/rw" ]) | |
60 | |
61 exec {"$directory": | |
62 command => "$dpkg_statoverride --update --add $dpkg_options", | |
63 unless => "$dpkg_statoverride --list $dpkg_options", | |
64 path => ["/usr/bin/", "/bin/"], | |
65 user => root, | |
66 notify => Service['nagios3'], | |
67 require => Package['nagios3'], | |
68 } | |
69 | |
70 exec {"$directory/rw": | |
71 command => "$dpkg_statoverride --update --add $dpkg_options_rw", | |
72 unless => "$dpkg_statoverride --list $dpkg_options_rw", | |
58 path => ["/usr/bin/", "/bin/"], | 73 path => ["/usr/bin/", "/bin/"], |
59 user => root, | 74 user => root, |
60 notify => Service['nagios3'], | 75 notify => Service['nagios3'], |
61 require => Package['nagios3'], | 76 require => Package['nagios3'], |
62 } | 77 } |
63 } | 78 } |
64 | 79 |
65 service {'nagios3': | 80 service {'nagios3': |
66 ensure => running, | 81 ensure => running, |
67 enable => true, | 82 enable => true, |
68 require => [ | 83 require => [Package['nagios3'], Package['pnp4nagios']] |
69 Package['nagios3'], | |
70 Package['pnp4nagios'], | |
71 ], | |
f.nicolaisen
2017/10/25 10:01:12
Hm, I accidentally included this change. I was wor
f.nicolaisen
2017/10/25 14:36:09
Acknowledged.
| |
72 } | 84 } |
73 | 85 |
74 service {'apache2': | 86 service {'apache2': |
75 ensure => stopped, | 87 ensure => stopped, |
76 enable => false, | 88 enable => false, |
77 require => Package['nagios3'], | 89 require => Package['nagios3'], |
78 before => Service['nagios3'] | 90 before => Service['nagios3'] |
79 } | 91 } |
80 | 92 |
81 file {'/etc/nagios3/htpasswd.users': | 93 file {'/etc/nagios3/htpasswd.users': |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 notify => Service['nagios3'] | 188 notify => Service['nagios3'] |
177 } | 189 } |
178 | 190 |
179 create_resources(nagios_contact, $contacts) | 191 create_resources(nagios_contact, $contacts) |
180 create_resources(nagios_contactgroup, $contactgroups) | 192 create_resources(nagios_contactgroup, $contactgroups) |
181 create_resources(nagios_command, $commands) | 193 create_resources(nagios_command, $commands) |
182 create_resources(nagios_service, $services) | 194 create_resources(nagios_service, $services) |
183 create_resources(nagios_host, $hosts) | 195 create_resources(nagios_host, $hosts) |
184 create_resources(nagios_hostgroup, $hostgroups) | 196 create_resources(nagios_hostgroup, $hostgroups) |
185 } | 197 } |
LEFT | RIGHT |