summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-03-09 17:38:09 +0100
committervarac <varacanero@zeromail.org>2016-03-09 17:38:09 +0100
commit3df00e29388adbf1c0e058df09a7c3886edbaca1 (patch)
treed07b60e6f54722097868e95f1e0491d3700934f5
parenta050fbb81b3b218518d079c6c83c6bcd48485340 (diff)
parent64d6017e17dfa1853bb05f0791fda9469d5cc96c (diff)
Merge remote-tracking branch 'shared/master' into leap_master
-rw-r--r--manifests/config.pp27
1 files changed, 14 insertions, 13 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
index d82044b..a9f99d8 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,3 +1,4 @@
+# Deploy check_mk config
class check_mk::config (
$site,
$host_groups = undef,
@@ -13,11 +14,10 @@ class check_mk::config (
# package provided and check_mk generated files, defined so the nagios
# module doesn't purge them
+ "${etc_dir}/${nagios_subdir}/conf.d":
+ ensure => directory;
"${etc_dir}/${nagios_subdir}/conf.d/check_mk":
ensure => directory;
- [ "${etc_dir}/${nagios_subdir}/conf.d/check_mk/check_mk_objects.cfg",
- "${etc_dir}/${nagios_subdir}/conf.d/check_mk/check_mk_templates.cfg" ]:
- ensure => present;
}
file_line { 'nagios-add-check_mk-cfg_dir':
ensure => present,
@@ -57,9 +57,9 @@ class check_mk::config (
# local list of hosts is in /omd/sites/${site}/etc/check_mk/all_hosts_static and is appended
concat::fragment { 'all-hosts-static':
- ensure => "${etc_dir}/check_mk/all_hosts_static",
- target => "${etc_dir}/check_mk/main.mk",
- order => 18,
+ ensure => "${etc_dir}/check_mk/all_hosts_static",
+ target => "${etc_dir}/check_mk/main.mk",
+ order => 18,
}
# host_groups
if $host_groups {
@@ -78,17 +78,17 @@ class check_mk::config (
}
$groups = keys($host_groups)
check_mk::hostgroup { $groups:
- dir => "${etc_dir}/nagios/local/hostgroups",
- hostgroups => $host_groups,
- target => "${etc_dir}/check_mk/main.mk",
- notify => Exec['check_mk-refresh']
+ dir => "${etc_dir}/nagios/local/hostgroups",
+ hostgroups => $host_groups,
+ target => "${etc_dir}/check_mk/main.mk",
+ notify => Exec['check_mk-refresh']
}
}
# local config is in /omd/sites/${site}/etc/check_mk/main.mk.local and is appended
concat::fragment { 'check_mk-local-config':
- ensure => "${etc_dir}/check_mk/main.mk.local",
- target => "${etc_dir}/check_mk/main.mk",
- order => 99,
+ ensure => "${etc_dir}/check_mk/main.mk.local",
+ target => "${etc_dir}/check_mk/main.mk",
+ order => 99,
}
# re-read config if it changes
exec { 'check_mk-refresh':
@@ -99,6 +99,7 @@ class check_mk::config (
exec { 'check_mk-reload':
command => "/bin/su -l -c '${bin_dir}/check_mk -O' ${site}",
refreshonly => true,
+ creates => '/etc/nagios3/conf.d/check_mk/check_mk_objects.cfg'
}
# re-read inventory at least daily
exec { 'check_mk-refresh-inventory-daily':