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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/nagios/files/nagios.cfg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nagios/manifests/server.pp
===================================================================
--- a/modules/nagios/manifests/server.pp
+++ b/modules/nagios/manifests/server.pp
@@ -1,4 +1,5 @@
class nagios::server(
+ $directory = hiera('nagios::server::directory', '/var/lib/nagios3'),
$domain,
$certificate,
$private_key,
@@ -50,6 +51,32 @@
require => Package['php5-cgi']
}
+ # See http://hub.eyeo.com/issues/4612#note-2
+ 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.
+
+ $dpkg_statoverride = 'dpkg-statoverride'
+ $dpkg_options = shellquote(['nagios', 'nagios', '751', "$directory"])
+ $dpkg_options_rw = shellquote(['nagios', 'www-data', '2710', "$directory/rw"])
+
+ exec {"$directory":
+ command => "$dpkg_statoverride --update --add $dpkg_options",
+ unless => "$dpkg_statoverride --list $dpkg_options",
+ path => ["/usr/bin/", "/bin/"],
+ user => root,
+ notify => Service['nagios3'],
+ require => Package['nagios3'],
+ }
+
+ exec {"$directory/rw":
+ command => "$dpkg_statoverride --update --add $dpkg_options_rw",
+ unless => "$dpkg_statoverride --list $dpkg_options_rw",
+ path => ["/usr/bin/", "/bin/"],
+ user => root,
+ notify => Service['nagios3'],
+ require => Package['nagios3'],
+ }
+ }
+
service {'nagios3':
ensure => running,
enable => true,
« 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