mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Make `icinga2::config' responsible for parent directory creation
refs #6842
This commit is contained in:
parent
4a2259a0df
commit
a82bafc07b
@ -23,10 +23,19 @@
|
||||
define icinga2::config ($source) {
|
||||
include icinga2
|
||||
|
||||
file { "/etc/icinga2/${name}.conf":
|
||||
$path = "/etc/icinga2/${name}.conf"
|
||||
$cmd = "mkdir-p-for-${path}"
|
||||
|
||||
exec { $cmd:
|
||||
command => "mkdir -p \"\$(dirname \"\$(readlink -m '${path}')\")\"",
|
||||
path => '/bin:/usr/bin',
|
||||
}
|
||||
|
||||
file { $path:
|
||||
source => "${source}/${name}.conf",
|
||||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
notify => Service['icinga2'],
|
||||
require => Exec[$cmd],
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user