mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
icinga2::config: outsource parent directory creation into module `parent_dirs'
refs #6842
This commit is contained in:
parent
413634280e
commit
03100d0d9a
@ -24,12 +24,8 @@ define icinga2::config ($source) {
|
||||
include icinga2
|
||||
|
||||
$path = "/etc/icinga2/${name}.conf"
|
||||
$cmd = "mkdir-p-for-${path}"
|
||||
|
||||
exec { $cmd:
|
||||
command => "mkdir -p \"\$(dirname \"\$(readlink -m '${path}')\")\"",
|
||||
path => '/bin:/usr/bin',
|
||||
}
|
||||
parent_dirs { $path: }
|
||||
|
||||
file { $path:
|
||||
source => "${source}/${name}.conf",
|
||||
@ -37,7 +33,7 @@ define icinga2::config ($source) {
|
||||
group => 'icinga',
|
||||
notify => Service['icinga2'],
|
||||
require => [
|
||||
Exec[$cmd],
|
||||
Parent_dirs[$path],
|
||||
User['icinga']
|
||||
],
|
||||
}
|
||||
|
6
.vagrant-puppet/modules/parent_dirs/manifests/init.pp
Normal file
6
.vagrant-puppet/modules/parent_dirs/manifests/init.pp
Normal file
@ -0,0 +1,6 @@
|
||||
define parent_dirs {
|
||||
exec { "parent_dirs-${name}":
|
||||
command => "mkdir -p \"\$(dirname \"\$(readlink -m '${name}')\")\"",
|
||||
path => '/bin:/usr/bin',
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user