Make `icinga2::feature' responsible for parent directory creation

refs #6842
This commit is contained in:
Alexander Klimov 2014-09-10 18:14:32 +02:00
parent 03100d0d9a
commit d5bfb3dbda
1 changed files with 12 additions and 5 deletions

View File

@ -13,15 +13,22 @@
define icinga2::feature ($source = undef) {
include icinga2
$target = "features-available/${name}"
$cfgpath = '/etc/icinga2'
$path = "${cfgpath}/features-enabled/${name}.conf"
if $source != undef {
icinga2::config { "features-available/${name}":
icinga2::config { $target:
source => $source,
}
}
file { "/etc/icinga2/features-enabled/${name}.conf":
ensure => link,
target => "/etc/icinga2/features-available/${name}.conf",
notify => Service['icinga2'],
parent_dirs { $path: }
file { $path:
ensure => link,
target => "${cfgpath}/${target}.conf",
require => Parent_dirs[$path],
notify => Service['icinga2'],
}
}