From 137cfda388841f242f51ce1e38ec37cf7a6407d9 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 1 Jul 2010 05:02:42 +0200 Subject: fix variable lookup and allow outside setting --- manifests/defaults/templates.pp | 3 ++- manifests/defaults/vars.pp | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 manifests/defaults/vars.pp (limited to 'manifests/defaults') 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 } + } +} -- cgit v1.2.3