summaryrefslogtreecommitdiff
path: root/puppet
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-01-29 18:57:56 +0100
committervarac <varacanero@zeromail.org>2013-01-29 18:57:56 +0100
commit64a3ec6ac5a064800a32170c2e8d058ab8b7dd62 (patch)
tree567b7abb3a3cd2be5658630144342bfd469f6e41 /puppet
parent4cc4237b1184b89b7c491267f8ddbc13067730b4 (diff)
Purge nagios config files on every run (Feature #1544)
Diffstat (limited to 'puppet')
-rw-r--r--puppet/modules/site_nagios/manifests/server.pp5
-rw-r--r--puppet/modules/site_nagios/manifests/server/purge.pp7
2 files changed, 12 insertions, 0 deletions
diff --git a/puppet/modules/site_nagios/manifests/server.pp b/puppet/modules/site_nagios/manifests/server.pp
index 7c17fe82..5e2f832b 100644
--- a/puppet/modules/site_nagios/manifests/server.pp
+++ b/puppet/modules/site_nagios/manifests/server.pp
@@ -1,5 +1,10 @@
class site_nagios::server inherits nagios::base {
+ # First, purge old nagios config (see #1467)
+ class { 'site_nagios::server::purge':
+ stage => initial
+ }
+
$nagios_hiera=hiera('nagios')
$nagiosadmin_pw = htpasswd_sha1($nagios_hiera['nagiosadmin_pw'])
$hosts = $nagios_hiera['hosts']
diff --git a/puppet/modules/site_nagios/manifests/server/purge.pp b/puppet/modules/site_nagios/manifests/server/purge.pp
new file mode 100644
index 00000000..66c27dd5
--- /dev/null
+++ b/puppet/modules/site_nagios/manifests/server/purge.pp
@@ -0,0 +1,7 @@
+class site_nagios::server::purge {
+ exec {'purge_conf.d':
+ command => '/bin/rm -rf /etc/nagios3/conf.d',
+ onlyif => 'test -e /etc/nagios3/conf.d'
+ }
+
+}