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:
parent
2826c0fa9f
commit
a087d65bba
2 changed files with 22 additions and 0 deletions
12
manifests/server/feature.pp
Normal file
12
manifests/server/feature.pp
Normal 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: }
|
||||
|
||||
}
|
10
manifests/server/feature/enable.pp
Normal file
10
manifests/server/feature/enable.pp
Normal 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'],
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue