summaryrefslogtreecommitdiff
path: root/manifests/defaults
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-07-01 05:02:42 +0200
committermh <mh@immerda.ch>2010-07-01 05:02:42 +0200
commit137cfda388841f242f51ce1e38ec37cf7a6407d9 (patch)
treec097cb5a9142ac2dbfe62c977488c275200ff585 /manifests/defaults
parentcdcc346bd6af7fc54fa7e3b0349d920774add0cc (diff)
fix variable lookup and allow outside setting
Diffstat (limited to 'manifests/defaults')
-rw-r--r--manifests/defaults/templates.pp3
-rw-r--r--manifests/defaults/vars.pp10
2 files changed, 12 insertions, 1 deletions
diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp
index 752ba60..bf8a6cf 100644
--- a/manifests/defaults/templates.pp
+++ b/manifests/defaults/templates.pp
@@ -1,7 +1,8 @@
class nagios::defaults::templates {
+ include nagios::defaults::vars
file { 'nagios_templates':
- path => "${nagios_cfgdir}/conf.d/nagios_templates.cfg",
+ path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_templates.cfg",
source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/nagios_templates.cfg",
"puppet://$server/modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg",
"puppet://$server/modules/site-nagios/configs/nagios_templates.cfg",
diff --git a/manifests/defaults/vars.pp b/manifests/defaults/vars.pp
new file mode 100644
index 0000000..6302f13
--- /dev/null
+++ b/manifests/defaults/vars.pp
@@ -0,0 +1,10 @@
+class nagios::defaults::vars {
+ case $nagios_cfgdir {
+ '': { $int_nagios_cfgdir = $operatingsystem ? {
+ centos => '/etc/nagios/',
+ default => '/etc/nagios3'
+ }
+ }
+ default: { $int_nagios_cfgdir = $nagios_cfgdir }
+ }
+}