adding class and define to enable icinga features/modules with icinga2-enable-feature command to create symlinks

Signed-off-by: Nick Chappell <nick@intronic.org>
This commit is contained in:
Steven Bambling 2014-09-30 16:45:41 -04:00 committed by Nick Chappell
parent 2826c0fa9f
commit a087d65bba
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# Enable Features for Icinga 2
class icinga2::server::feature (
$features = [],
) {
# Do some checking
validate_array($features)
# Pass the features arry to the define to loop though
icinga::server::feature::enable { $features: }
}

View file

@ -0,0 +1,10 @@
# Enable Icinga 2 Features/Modules
define icinga2::server::feature::enable () {
exec { "icinga2-enable-feature ${name}":
user => 'root',
path => '/usr/bin:/usr/sbin:/bin/:/sbin',
command => "/usr/sbin/icinga2-enable-feature ${name}",
unless => "[ -f /etc/icinga2/features-enabled/${name}.conf ]",
require => Class['icinga2::server::install::packages'],
}
}