From 64a3ec6ac5a064800a32170c2e8d058ab8b7dd62 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 29 Jan 2013 18:57:56 +0100 Subject: Purge nagios config files on every run (Feature #1544) --- puppet/modules/site_nagios/manifests/server.pp | 5 +++++ puppet/modules/site_nagios/manifests/server/purge.pp | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 puppet/modules/site_nagios/manifests/server/purge.pp (limited to 'puppet/modules') 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' + } + +} -- cgit v1.2.3