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'), |
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!
|
$domain, |
$certificate, |
$private_key, |
@@ -50,6 +51,32 @@ |
require => Package['php5-cgi'] |
} |
+ # See http://hub.eyeo.com/issues/4612#note-2 |
+ if $::osfamily == 'Debian' { |
+ |
+ $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, |