From 363bdd5c7519aea45be143f4a19c10dc41a9b03f Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Wed, 1 Feb 2012 16:56:49 -0800 Subject: Fully qualify facter variables to suppress warnings --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 1aecc3a..5050b69 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,7 +21,7 @@ class nagios { 'apache': { include apache } default: { include apache } } - case $operatingsystem { + case $::operatingsystem { 'centos': { $nagios_cfgdir = '/etc/nagios' include nagios::centos @@ -30,6 +30,6 @@ class nagios { $nagios_cfgdir = '/etc/nagios3' include nagios::debian } - default: { fail("No such operatingsystem: $operatingsystem yet defined") } + default: { fail("No such operatingsystem: ${::operatingsystem} yet defined") } } } -- cgit v1.2.3 From 0fe7552f256f0b1508cc5d3cab952eb93bee6811 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:34:51 -0300 Subject: new style for 2.7 --- manifests/init.pp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 5050b69..d3a00df 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,14 +8,17 @@ # Marcel Härry haerry+puppet(at)puzzle.ch # Simon Josi josi+puppet(at)puzzle.ch # -# This program is free software; you can redistribute -# it and/or modify it under the terms of the GNU -# General Public License version 3 as published by +# This program is free software; you can redistribute +# it and/or modify it under the terms of the GNU +# General Public License version 3 as published by # the Free Software Foundation. # -class nagios { - case $nagios_httpd { +class nagios( + $httpd = hiera('nagios_httpd','apache'), + $allow_external_cmd = hiera('nagios_allow_external_cmd',false), +) { + case $nagios::httpd { 'absent': { } 'lighttpd': { include lighttpd } 'apache': { include apache } @@ -23,11 +26,11 @@ class nagios { } case $::operatingsystem { 'centos': { - $nagios_cfgdir = '/etc/nagios' + $cfgdir = '/etc/nagios' include nagios::centos } 'debian': { - $nagios_cfgdir = '/etc/nagios3' + $cfgdir = '/etc/nagios3' include nagios::debian } default: { fail("No such operatingsystem: ${::operatingsystem} yet defined") } -- cgit v1.2.3 From 106515b61b731489cce2d8b74bea13b26d4a65f6 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 8 Jun 2012 13:04:33 -0300 Subject: refactor things for >2.7 --- manifests/init.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index d3a00df..9952cd9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,9 +20,9 @@ class nagios( ) { case $nagios::httpd { 'absent': { } - 'lighttpd': { include lighttpd } - 'apache': { include apache } - default: { include apache } + 'lighttpd': { include ::lighttpd } + 'apache': { include ::apache } + default: { include ::apache } } case $::operatingsystem { 'centos': { -- cgit v1.2.3 From 41fe95b36253826b8f801ee1669acdb28c70076c Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 14 Jun 2012 10:36:25 -0300 Subject: take hiera out of the params --- manifests/init.pp | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 9952cd9..12d3db2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -15,24 +15,29 @@ # class nagios( - $httpd = hiera('nagios_httpd','apache'), - $allow_external_cmd = hiera('nagios_allow_external_cmd',false), + $httpd = 'apache', + $allow_external_cmd = false, + $manage_shorewall = false, + $manage_munin = false ) { - case $nagios::httpd { - 'absent': { } - 'lighttpd': { include ::lighttpd } - 'apache': { include ::apache } - default: { include ::apache } + case $nagios::httpd { + 'absent': { } + 'lighttpd': { include ::lighttpd } + 'apache': { include ::apache } + default: { include ::apache } + } + case $::operatingsystem { + 'centos': { + $cfgdir = '/etc/nagios' + include nagios::centos } - case $::operatingsystem { - 'centos': { - $cfgdir = '/etc/nagios' - include nagios::centos - } - 'debian': { - $cfgdir = '/etc/nagios3' - include nagios::debian - } - default: { fail("No such operatingsystem: ${::operatingsystem} yet defined") } + 'debian': { + $cfgdir = '/etc/nagios3' + include nagios::debian } + default: { fail("No such operatingsystem: ${::operatingsystem} yet defined") } + } + if $manage_munin { + include nagios::munin + } } -- cgit v1.2.3