2014-09-30 22:45:41 +02:00
|
|
|
# Enable Features for Icinga 2
|
2014-09-30 23:00:12 +02:00
|
|
|
class icinga2::server::features (
|
2014-09-30 23:42:41 +02:00
|
|
|
$enabled_features = $icinga2::server::server_enabled_features,
|
2014-10-02 13:00:43 +02:00
|
|
|
$disabled_features = $icinga2::server::server_disabled_features,
|
2014-09-30 22:45:41 +02:00
|
|
|
) {
|
|
|
|
|
2014-10-02 14:42:06 +02:00
|
|
|
include stdlib
|
|
|
|
|
2014-09-30 22:45:41 +02:00
|
|
|
# Do some checking
|
2014-09-30 23:08:46 +02:00
|
|
|
validate_array($enabled_features)
|
2014-10-02 13:00:43 +02:00
|
|
|
validate_array($disabled_features)
|
2014-09-30 22:45:41 +02:00
|
|
|
|
2014-10-02 14:42:06 +02:00
|
|
|
#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)
|
|
|
|
|
2014-10-02 13:00:43 +02:00
|
|
|
#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
|
2014-10-02 14:42:06 +02:00
|
|
|
icinga2::server::features::enable { $updated_enabled_features: }
|
2014-09-30 22:45:41 +02:00
|
|
|
|
|
|
|
}
|