summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nagios
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-02-11 17:39:37 +0100
committervarac <varacanero@zeromail.org>2014-02-11 17:39:37 +0100
commit142eee6d9162c762c35fb79312ec572ce274b6d0 (patch)
treea7c66f017fbfdc4f07846c02114c6a69cffc1e21 /puppet/modules/site_nagios
parent9a13819dbe7c8e8a51f802356e6fbebe32a7a11f (diff)
properly purge nagios3/conf.d dir
Diffstat (limited to 'puppet/modules/site_nagios')
-rw-r--r--puppet/modules/site_nagios/manifests/server/purge.pp5
1 files changed, 3 insertions, 2 deletions
diff --git a/puppet/modules/site_nagios/manifests/server/purge.pp b/puppet/modules/site_nagios/manifests/server/purge.pp
index 18993586..1c12cfb0 100644
--- a/puppet/modules/site_nagios/manifests/server/purge.pp
+++ b/puppet/modules/site_nagios/manifests/server/purge.pp
@@ -10,8 +10,9 @@ class site_nagios::server::purge inherits nagios::base {
purge => false
}
+ # only purge find in the /etc/nagios3/conf.d/ dir, not in any subdir
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_"'
+ command => '/usr/bin/find /etc/nagios3/conf.d/ -maxdepth 1 -type f -exec rm {} \;',
+ onlyif => '/usr/bin/find /etc/nagios3/conf.d/ -maxdepth 1 -type f | grep -q "/etc/nagios3/conf.d"'
}
}