summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2014-10-04 16:28:56 +0200
committermh <mh@immerda.ch>2014-10-04 16:28:56 +0200
commit8eafd6fdca47b6b6ae08b0313c0fcf1e13b4a886 (patch)
tree9240ef5f3ec79c8feb7728eb3605bd4d5bfca84e
parentaf089ee1d1d0e6f7f8a1e543e3d75babfff74245 (diff)
purge any unmanaged resources
-rw-r--r--manifests/base.pp23
-rw-r--r--manifests/init.pp1
2 files changed, 24 insertions, 0 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 50a302c..2ef1181 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -87,6 +87,27 @@ class nagios::base {
Nagios_serviceextinfo <<||>>
Nagios_service <<||>>
Nagios_timeperiod <<||>>
+ if $nagios::purge_resources {
+ resources {
+ [
+ 'nagios_command',
+ 'nagios_contactgroup',
+ 'nagios_contact',
+ 'nagios_hostdependency',
+ 'nagios_hostescalation',
+ 'nagios_hostextinfo',
+ 'nagios_hostgroup',
+ 'nagios_host',
+ 'nagios_servicedependency',
+ 'nagios_serviceescalation',
+ 'nagios_servicegroup',
+ 'nagios_serviceextinfo',
+ 'nagios_service',
+ 'nagios_timeperiod',
+ ]:
+ purge => true;
+ }
+ }
Nagios_command <||> {
target => "${cfg_dir}/conf.d/nagios_command.cfg",
@@ -190,6 +211,8 @@ class nagios::base {
owner => root,
group => 0,
mode => '0644';
+ # unfortuantely resource purging only works on the default path and
+ # because we changed it above -> link the default path
"${cfg_dir}/nagios_command.cfg":
ensure => link,
target => "${cfg_dir}/conf.d/nagios_command.cfg";
diff --git a/manifests/init.pp b/manifests/init.pp
index efbfd02..7b747d9 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -21,6 +21,7 @@ class nagios(
$manage_shorewall = false,
$manage_munin = false,
$service_atboot = true,
+ $purge_resources = true,
) {
case $nagios::httpd {
'absent': { }