Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/nagios/manifests/server.pp

Issue 29587724: #4612 - Enable External Commands in Nagios (Closed) Base URL: https://hg1/infrastructure
Patch Set: nicer dpkg_statoverride Created Oct. 25, 2017, 2:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « modules/nagios/files/nagios.cfg ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class nagios::server( 1 class nagios::server(
2 $directory = hiera('nagios::server::directory', '/var/lib/nagios3'),
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
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 $::operatingsystem == 'Debian' {
mathias 2017/10/25 14:40:55 The condition should use $::osfamily, each associa
f.nicolaisen 2017/10/25 15:10:29 Acknowledged.
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
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 }
OLDNEW
« no previous file with comments | « modules/nagios/files/nagios.cfg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld