icingaweb2/.puppet/modules/icinga2/manifests/feature.pp

39 lines
679 B
Puppet
Raw Normal View History

# Define: icinga2::feature
#
# Enable Icinga 2 feature
#
# Requires:
#
# icinga2
#
# Sample Usage:
#
# icinga2::feature { 'example-feature'; }
#
define icinga2::feature ($source = undef) {
2014-08-28 13:08:42 +02:00
include icinga2
$target = "features-available/${name}"
$cfgpath = '/etc/icinga2'
$path = "${cfgpath}/features-enabled/${name}.conf"
if $source != undef {
icinga2::config { $target:
source => $source,
}
}
parent_dirs { $path:
user => 'icinga',
require => [
User['icinga'],
File['icinga2cfgDir']
],
}
-> file { $path:
ensure => link,
target => "${cfgpath}/${target}.conf",
notify => Service['icinga2'],
}
}