diff options
-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 | 2 | ||||
-rw-r--r-- | manifests/irc_bot/base.pp | 2 |
8 files changed, 16 insertions, 16 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 e770cf8..3e3f0e1 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; @@ -36,9 +36,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'], @@ -62,8 +62,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 1213485..aefed8a 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: @@ -124,7 +124,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 7629b94..ea8d79b 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -3,7 +3,7 @@ class nagios::irc_bot { fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") } - case $operatingsystem { + case $::operatingsystem { centos: { $nagios_nsa_default_socket = '/var/run/nagios-nsa/nsa.socket' $nagios_nsa_default_pidfile = '/var/run/nagios-nsa/nsa.pid' diff --git a/manifests/irc_bot/base.pp b/manifests/irc_bot/base.pp index c36d8e6..ee3ea39 100644 --- a/manifests/irc_bot/base.pp +++ b/manifests/irc_bot/base.pp @@ -36,7 +36,7 @@ class nagios::irc_bot::base { } file { "/etc/init.d/nagios-nsa": owner => root, group => 0, 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": |