Commit a3fd9097 authored by Markus Frosch's avatar Markus Frosch
Browse files

selftest: Move commands to global zone (needs global zone from hiera)

parent 24e9e49a
......@@ -12,10 +12,13 @@ class icinga2_testing::profiles::selftest(
notify => Class['::icinga2::service'],
}
$zone_dir = "/etc/icinga2/zones.d/${zone}"
$zones_d = '/etc/icinga2/zones.d'
$zone_dir = "${zones_d}/${zone}"
$global_zone = "${zones_d}/global"
$config_base = "${zone_dir}/selftest"
ensure_resource(file, $zone_dir, { ensure => directory })
ensure_resource(file, $global_zone, { ensure => directory })
$_zones = hiera_hash('icinga2::object::zone')
......@@ -28,14 +31,19 @@ class icinga2_testing::profiles::selftest(
"${config_base}/templates.conf":
ensure => file,
content => template('icinga2_testing/selftest/templates.conf.erb');
"${config_base}/commands.conf":
ensure => file,
content => template('icinga2_testing/selftest/commands.conf.erb');
"${config_base}/hosts.conf":
ensure => file,
content => template('icinga2_testing/selftest/hosts.conf.erb');
"${config_base}/services.conf":
ensure => file,
content => template('icinga2_testing/selftest/services.conf.erb');
"${global_zone}/selftest":
ensure => directory,
force => true,
purge => true,
recurse => true;
"${global_zone}/selftest/commands.conf":
ensure => file,
content => template('icinga2_testing/selftest/commands.conf.erb');
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment