[icinga-checkins] icinga.org: puppet-icinga2/develop: Added a parameter that controls whether non-Puppet managed object files get purged.

git at icinga.org git at icinga.org
Sat Nov 22 06:54:04 CET 2014


Module: puppet-icinga2
Branch: develop
Commit: 17d230eb2b3b34be8db499a4f93e92651d77538a
URL:    https://git.icinga.org/?p=puppet-icinga2.git;a=commit;h=17d230eb2b3b34be8db499a4f93e92651d77538a

Author: Nick Chappell <nick at intronic.org>
Date:   Fri Nov 21 21:49:26 2014 -0800

Added a parameter that controls whether non-Puppet managed object files get purged.

---

 manifests/params.pp        |    3 +++
 manifests/server.pp        |    1 +
 manifests/server/config.pp |   15 +++++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/manifests/params.pp b/manifests/params.pp
index f0382bb..0871254 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -235,6 +235,9 @@ class icinga2::params {
     #Fail if we're on any other OS:
     default: { fail("${::operatingsystem} is not supported!") }
   }
+  
+  #Whether to purge object files or directories in /etc/icinga2/objects that aren't managed by Puppet
+  $purge_unmanaged_object_files = false
 
   ##################
   # Icinga 2 server service settings
diff --git a/manifests/server.pp b/manifests/server.pp
index e93a15f..32d9932 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -26,6 +26,7 @@ class icinga2::server (
   $install_mail_utils_package = $icinga2::params::install_mail_utils_package,
   $server_enabled_features = $icinga2::params::server_enabled_features,
   $server_disabled_features = $icinga2::params::server_disabled_features,
+  $purge_unmanaged_object_files = $icinga2::params::purge_unmanaged_object_files
 ) inherits icinga2::params {
 
   #Do some validation of parameters so we know we have the right data types:
diff --git a/manifests/server/config.pp b/manifests/server/config.pp
index 989d280..ee46770 100644
--- a/manifests/server/config.pp
+++ b/manifests/server/config.pp
@@ -15,6 +15,18 @@ class icinga2::server::config inherits icinga2::server {
 
   include icinga2::params
 
+  if $purge_unmanaged_object_files == true {
+    $recurse_objects = true
+    $purge_objects = true
+    $force_purge = true
+  }
+  else {
+    $recurse_objects = false
+    $purge_objects = false
+    $force_purge = true
+  }
+  
+
   #Directory resource for /etc/icinga2/:
   file { '/etc/icinga2/':
     ensure  => directory,
@@ -99,6 +111,9 @@ class icinga2::server::config inherits icinga2::server {
     owner   => $etc_icinga2_obejcts_owner,
     group   => $etc_icinga2_obejcts_group,
     mode    => $etc_icinga2_obejcts_mode,
+    recurse => $recurse_objects,
+    purge   => $purge_objects,
+    force   => $force_purge
   }
 
   #Directory resource for /etc/icinga2/objects/hosts/:



More information about the icinga-checkins mailing list