Left: | ||
Right: |
OLD | NEW |
---|---|
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 log => 'access_log_monitoring' | 44 log => 'access_log_monitoring' |
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 |
54 # See http://hub.eyeo.com/issues/4612#note-2 | |
55 if $::osfamily == 'Debian' { | |
56 | |
57 $dpkg_statoverride = 'dpkg-statoverride' | |
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", | |
73 path => ["/usr/bin/", "/bin/"], | |
74 user => root, | |
75 notify => Service['nagios3'], | |
76 require => Package['nagios3'], | |
77 } | |
78 } | |
79 | |
53 service {'nagios3': | 80 service {'nagios3': |
54 ensure => running, | 81 ensure => running, |
55 enable => true, | 82 enable => true, |
56 require => [Package['nagios3'], Package['pnp4nagios']] | 83 require => [Package['nagios3'], Package['pnp4nagios']] |
57 } | 84 } |
58 | 85 |
59 service {'apache2': | 86 service {'apache2': |
60 ensure => stopped, | 87 ensure => stopped, |
61 enable => false, | 88 enable => false, |
62 require => Package['nagios3'], | 89 require => Package['nagios3'], |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 notify => Service['nagios3'] | 188 notify => Service['nagios3'] |
162 } | 189 } |
163 | 190 |
164 create_resources(nagios_contact, $contacts) | 191 create_resources(nagios_contact, $contacts) |
165 create_resources(nagios_contactgroup, $contactgroups) | 192 create_resources(nagios_contactgroup, $contactgroups) |
166 create_resources(nagios_command, $commands) | 193 create_resources(nagios_command, $commands) |
167 create_resources(nagios_service, $services) | 194 create_resources(nagios_service, $services) |
168 create_resources(nagios_host, $hosts) | 195 create_resources(nagios_host, $hosts) |
169 create_resources(nagios_hostgroup, $hostgroups) | 196 create_resources(nagios_hostgroup, $hostgroups) |
170 } | 197 } |
OLD | NEW |