checking to make sure feature is available before enabling it

Signed-off-by: Nick Chappell <nick@intronic.org>
This commit is contained in:
Steven Bambling 2014-10-02 06:54:48 -04:00 committed by Nick Chappell
parent 2f2b781bd1
commit a7caedcaa4

View file

@ -4,7 +4,7 @@ define icinga2::server::feature::enable () {
user => 'root',
path => '/usr/bin:/usr/sbin:/bin/:/sbin',
command => "/usr/sbin/icinga2-enable-feature ${name}",
unless => "[ -f /etc/icinga2/features-enabled/${name}.conf ]",
unless => "[ ! -f /etc/icinga2/features-available/${name}.conf ] || [ -f /etc/icinga2/features-enabled/${name}.conf ]",
require => Class['icinga2::server::install::packages'],
}
}