Make `icinga2::feature' responsible for parent directory creation
refs #6842
This commit is contained in:
parent
03100d0d9a
commit
d5bfb3dbda
|
@ -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'],
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue