summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-02-08 14:00:10 +0100
committervarac <varacanero@zeromail.org>2014-02-08 14:00:10 +0100
commit6720bdba0c67893de713eee7f753fb582d06aa61 (patch)
tree45719cd2ef640ba96577ba8ffa1056611c73c7c5 /puppet
parentf2f019d402345d6133cdfb6274d4b78d44e08ec9 (diff)
disable purging of /etc/nagios3 and /etc/nagios3/conf.d
Diffstat (limited to 'puppet')
-rw-r--r--puppet/modules/site_nagios/manifests/server/purge.pp18
1 files changed, 14 insertions, 4 deletions
diff --git a/puppet/modules/site_nagios/manifests/server/purge.pp b/puppet/modules/site_nagios/manifests/server/purge.pp
index 39735cd3..18993586 100644
--- a/puppet/modules/site_nagios/manifests/server/purge.pp
+++ b/puppet/modules/site_nagios/manifests/server/purge.pp
@@ -1,7 +1,17 @@
-class site_nagios::server::purge {
- exec {'purge_conf.d':
- command => '/bin/rm -rf /etc/nagios3/conf.d/*',
- onlyif => 'test -e /etc/nagios3/conf.d'
+class site_nagios::server::purge inherits nagios::base {
+ # we don't want to get /etc/nagios3 and /etc/nagios3/conf.d
+ # purged, cause the check-mk-config-nagios3 package
+ # places its templates in /etc/nagios3/conf.d/check_mk,
+ # and check_mk -O updated it's nagios config in /etc/nagios3/conf.d/check_mk
+ File['nagios_cfgdir'] {
+ purge => false
+ }
+ File['nagios_confd'] {
+ purge => false
}
+ exec {'purge_conf.d':
+ command => '/bin/rm -f /etc/nagios3/conf.d/nagios_*',
+ onlyif => 'find /etc/nagios3/conf.d/ | grep -q "/etc/nagios3/conf.d/nagios_"'
+ }
}