getting difference and not enabling services listed as disabled even if also listed as enabled

Signed-off-by: Nick Chappell <nick@intronic.org>
This commit is contained in:
Steven Bambling 2014-10-02 08:42:06 -04:00 committed by Nick Chappell
parent 01e3430242
commit 50a07737ab

View file

@ -4,14 +4,20 @@ class icinga2::server::features (
$disabled_features = $icinga2::server::server_disabled_features,
) {
include stdlib
# Do some checking
validate_array($enabled_features)
validate_array($disabled_features)
#Compare the enabled and disabled feature arrays
#Remove enabled features that are also listed to be disabled
$updated_enabled_features = difference($enabled_features,$disabled_features)
#Pass the disabled features array to the define for looping
icinga2::server::features::disable { $disabled_features: }
#Pass the features array to the define for looping
icinga2::server::features::enable { $enabled_features: }
icinga2::server::features::enable { $updated_enabled_features: }
}