puppet: Let icingaweb2::config::module() use the config path defined by hiera

This commit is contained in:
Eric Lippmann 2014-12-10 15:17:15 +01:00
parent 513fbe6461
commit bf68ecfa8c
1 changed files with 23 additions and 4 deletions

View File

@ -1,6 +1,25 @@
define icingaweb2::config::module ($source, $module = 'monitoring', $replace = true) {
icingaweb2::config::general { "modules/${module}/${name}":
source => $source,
define icingaweb2::config::module (
$module,
$source,
$config = hiera('icingaweb2::config'),
$replace = true
) {
include icingaweb2::config
if ! defined(File["${config}/modules/${module}"]) {
file { "${config}/modules/${module}":
ensure => directory,
owner => 'root',
group => 'icingaweb',
mode => '2770',
}
}
file { "${config}/modules/${module}/${name}.ini":
source => "${source}/modules/${module}/${name}.ini",
owner => 'root',
group => 'icingaweb',
mode => 0660,
replace => $replace,
}
}