diff options
author | duritong <peter.meier+github@immerda.ch> | 2012-02-02 01:10:54 -0800 |
---|---|---|
committer | duritong <peter.meier+github@immerda.ch> | 2012-02-02 01:10:54 -0800 |
commit | 108a2f0483b39901a0cbb321a9de63a2cf3c49ac (patch) | |
tree | e0428c6a25b5e6e946a9427f808837937303746f /manifests | |
parent | f2df62c9d17d481a3d616a4f2de9496638fadc0a (diff) | |
parent | 9e22cc72124c9eb1612f62653ea92538bac06855 (diff) |
Merge pull request #3 from cwarden/fully-qualify-variables
Fully qualify facter variables to suppress warnings
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/apache.pp | 2 | ||||
-rw-r--r-- | manifests/base.pp | 12 | ||||
-rw-r--r-- | manifests/defaults/commands.pp | 4 | ||||
-rw-r--r-- | manifests/defaults/templates.pp | 4 | ||||
-rw-r--r-- | manifests/defaults/vars.pp | 2 | ||||
-rw-r--r-- | manifests/init.pp | 4 | ||||
-rw-r--r-- | manifests/irc_bot.pp | 8 | ||||
-rw-r--r-- | manifests/service.pp | 4 |
8 files changed, 20 insertions, 20 deletions
diff --git a/manifests/apache.pp b/manifests/apache.pp index c560e5b..6acf538 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -2,7 +2,7 @@ class nagios::apache inherits ::apache { $nagios_httpd = 'apache' include nagios - case $operatingsystem { + case $::operatingsystem { 'debian': { file { "${nagios::defaults::vars::int_nagios_cfgdir}/apache2.conf": ensure => present, diff --git a/manifests/base.pp b/manifests/base.pp index 8b96308..315298d 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -18,9 +18,9 @@ class nagios::base { file { 'nagios_main_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/nagios.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios.cfg", - "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios.cfg", + "puppet:///modules/site-nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/site-nagios/configs/nagios.cfg", - "puppet:///modules/nagios/configs/${operatingsystem}/nagios.cfg", + "puppet:///modules/nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/nagios/configs/nagios.cfg" ], notify => Service['nagios'], mode => 0644, owner => root, group => root; @@ -29,9 +29,9 @@ class nagios::base { file { 'nagios_cgi_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/cgi.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/cgi.cfg", - "puppet:///modules/site-nagios/configs/${operatingsystem}/cgi.cfg", + "puppet:///modules/site-nagios/configs/${::operatingsystem}/cgi.cfg", "puppet:///modules/site-nagios/configs/cgi.cfg", - "puppet:///modules/nagios/configs/${operatingsystem}/cgi.cfg", + "puppet:///modules/nagios/configs/${::operatingsystem}/cgi.cfg", "puppet:///modules/nagios/configs/cgi.cfg" ], mode => '0644', owner => 'root', group => 0, notify => Service['apache'], @@ -56,8 +56,8 @@ class nagios::base { file { 'nagios_private_resource_cfg': path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/resource.cfg", - source => [ "puppet:///modules/site-nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}", - "puppet:///modules/nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}" ], + source => [ "puppet:///modules/site-nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}", + "puppet:///modules/nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}" ], notify => Service['nagios'], owner => root, group => nagios, mode => '0640'; } diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 17d1408..3b0da37 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -4,7 +4,7 @@ class nagios::defaults::commands { include nagios::command::imap_pop3 # common service commands - case $operatingsystem { + case $::operatingsystem { debian,ubuntu: { nagios_command { check_dummy: @@ -122,7 +122,7 @@ class nagios::defaults::commands { # notification commands - $mail_cmd_location = $operatingsystem ? { + $mail_cmd_location = $::operatingsystem ? { centos => '/bin/mail', default => '/usr/bin/mail' } diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp index c97eee4..aec97c0 100644 --- a/manifests/defaults/templates.pp +++ b/manifests/defaults/templates.pp @@ -4,9 +4,9 @@ class nagios::defaults::templates { file { 'nagios_templates': path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_templates.cfg", source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios_templates.cfg", - "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg", + "puppet:///modules/site-nagios/configs/${::operatingsystem}/nagios_templates.cfg", "puppet:///modules/site-nagios/configs/nagios_templates.cfg", - "puppet:///modules/nagios/configs/${operatingsystem}/nagios_templates.cfg", + "puppet:///modules/nagios/configs/${::operatingsystem}/nagios_templates.cfg", "puppet:///modules/nagios/configs/nagios_templates.cfg" ], notify => Service['nagios'], mode => 0644, owner => root, group => root; diff --git a/manifests/defaults/vars.pp b/manifests/defaults/vars.pp index 6302f13..b0aef57 100644 --- a/manifests/defaults/vars.pp +++ b/manifests/defaults/vars.pp @@ -1,6 +1,6 @@ class nagios::defaults::vars { case $nagios_cfgdir { - '': { $int_nagios_cfgdir = $operatingsystem ? { + '': { $int_nagios_cfgdir = $::operatingsystem ? { centos => '/etc/nagios/', default => '/etc/nagios3' } 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") } } } diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 961755a..fc47884 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -4,14 +4,14 @@ class nagios::irc_bot { } $nagios_nsa_socket = $nagios_nsa_socket ? { - '' => $operatingsystem ? { + '' => $::operatingsystem ? { centos => '/var/run/nagios-nsa/nsa.socket', default => '/var/run/nagios3/nsa.socket' }, default => $nagios_nsa_socket, } $nagios_nsa_pidfile = $nagios_nsa_pidfile ? { - '' => $operatingsystem ? { + '' => $::operatingsystem ? { centos => '/var/run/nagios-nsa/nsa.pid', default => '/var/run/nagios3/nsa.pid' }, @@ -40,7 +40,7 @@ class nagios::irc_bot { } file { "/etc/init.d/nagios-nsa": owner => root, group => root, mode => 0755, - content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), + content => template("nagios/irc_bot/${::operatingsystem}/nagios-nsa.sh.erb"), require => File["/usr/local/bin/riseup-nagios-server.pl"], } file { "/etc/nagios_nsa.cfg": @@ -61,7 +61,7 @@ class nagios::irc_bot { Service['nagios'] ], } - case $operatingsystem { + case $::operatingsystem { centos: { Package['libnet-irc-perl']{ name => 'perl-Net-IRC', diff --git a/manifests/service.pp b/manifests/service.pp index afc8650..a739317 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -1,6 +1,6 @@ define nagios::service ( $ensure = present, - $host_name = $fqdn, + $host_name = $::fqdn, $check_command, $check_period = '', $normal_check_interval = '', @@ -16,7 +16,7 @@ define nagios::service ( # TODO: this resource should normally accept all nagios_host parameters - $real_name = "${hostname}_${name}" + $real_name = "${::hostname}_${name}" @@nagios_service { "${real_name}": ensure => $ensure, |