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

This commit is contained in:
Nick Chappell 2014-11-21 21:49:26 -08:00
parent 13e1100d0c
commit 17d230eb2b
3 changed files with 19 additions and 0 deletions

View file

@ -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

View file

@ -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:

View file

@ -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/: