diff options
author | Micah Anderson <micah@riseup.net> | 2011-04-28 17:12:24 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2011-04-28 18:07:49 -0400 |
commit | 5bfc4bb9490b0001343ffe011aea978c36f3e1f3 (patch) | |
tree | 7503a731c7130630f35d62a4c7cf1f7f7c69e260 | |
parent | b5d1ad97b2b33d9a64991616ebe42bc9e0be8737 (diff) |
fix formatting to be standard
-rw-r--r-- | manifests/irc_bot.pp | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp index 961755a..31d7add 100644 --- a/manifests/irc_bot.pp +++ b/manifests/irc_bot.pp @@ -1,93 +1,93 @@ class nagios::irc_bot { - if ( ! ($nagios_nsa_server and $nagios_nsa_nickname and $nagios_nsa_channel) ) { - fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") - } + if ( ! ($nagios_nsa_server and $nagios_nsa_nickname and $nagios_nsa_channel) ) { + fail("Please provide values at least for \$nagios_nsa_server, \$nagios_nsa_nickname and \$nagios_nsa_channel") + } - $nagios_nsa_socket = $nagios_nsa_socket ? { - '' => $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 ? { - centos => '/var/run/nagios-nsa/nsa.pid', - default => '/var/run/nagios3/nsa.pid' - }, - default => $nagios_nsa_pidfile, - } - $nagios_nsa_port = $nagios_nsa_port ? { - '' => '6667', - default => $nagios_nsa_port, - } - $nagios_nsa_realname = $nagios_nsa_realname ? { - '' => 'Nagios', - default => $nagios_nsa_realname, - } + $nagios_nsa_socket = $nagios_nsa_socket ? { + '' => $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 ? { + centos => '/var/run/nagios-nsa/nsa.pid', + default => '/var/run/nagios3/nsa.pid' + }, + default => $nagios_nsa_pidfile, + } + $nagios_nsa_port = $nagios_nsa_port ? { + '' => '6667', + default => $nagios_nsa_port, + } + $nagios_nsa_realname = $nagios_nsa_realname ? { + '' => 'Nagios', + default => $nagios_nsa_realname, + } - if (! $nagios_nsa_password) { - $nagios_nsa_password = '' - } + if (! $nagios_nsa_password) { + $nagios_nsa_password = '' + } - file { "/usr/local/bin/riseup-nagios-client.pl": - owner => root, group => root, mode => 0755, - source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", - } - file { "/usr/local/bin/riseup-nagios-server.pl": - owner => root, group => root, mode => 0755, - source => "puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl", - } - file { "/etc/init.d/nagios-nsa": - owner => root, group => root, mode => 0755, - content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), - require => File["/usr/local/bin/riseup-nagios-server.pl"], - } - file { "/etc/nagios_nsa.cfg": - ensure => present, - owner => nagios, group => root, mode => 0400, - content => template('nagios/irc_bot/nsa.cfg.erb'), - } + file { "/usr/local/bin/riseup-nagios-client.pl": + owner => root, group => root, mode => 0755, + source => "puppet:///modules/nagios/irc_bot/riseup-nagios-client.pl", + } + file { "/usr/local/bin/riseup-nagios-server.pl": + owner => root, group => root, mode => 0755, + source => "puppet:///modules/nagios/irc_bot/riseup-nagios-server.pl", + } + file { "/etc/init.d/nagios-nsa": + owner => root, group => root, mode => 0755, + content => template("nagios/irc_bot/${operatingsystem}/nagios-nsa.sh.erb"), + require => File["/usr/local/bin/riseup-nagios-server.pl"], + } + file { "/etc/nagios_nsa.cfg": + ensure => present, + owner => nagios, group => root, mode => 0400, + content => template('nagios/irc_bot/nsa.cfg.erb'), + } - package { "libnet-irc-perl": - ensure => present, - } + package { "libnet-irc-perl": + ensure => present, + } - service { "nagios-nsa": - ensure => "running", - hasstatus => true, - require => [File["/etc/nagios_nsa.cfg"], - Package["libnet-irc-perl"], - Service['nagios'] ], - } + service { "nagios-nsa": + ensure => "running", + hasstatus => true, + require => [File["/etc/nagios_nsa.cfg"], + Package["libnet-irc-perl"], + Service['nagios'] ], + } - case $operatingsystem { - centos: { - Package['libnet-irc-perl']{ - name => 'perl-Net-IRC', - } - Service['nagios-nsa']{ - enable => true, - } - } - debian,ubuntu: { - exec { "nagios_nsa_init_script": - command => "/usr/sbin/update-rc.d nagios-nsa defaults", - unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa", - require => File["/etc/init.d/nagios-nsa"], - before => Service['nagios-nsa'], - } + case $operatingsystem { + centos: { + Package['libnet-irc-perl']{ + name => 'perl-Net-IRC', + } + Service['nagios-nsa']{ + enable => true, + } + } + debian,ubuntu: { + exec { "nagios_nsa_init_script": + command => "/usr/sbin/update-rc.d nagios-nsa defaults", + unless => "/bin/ls /etc/rc3.d/ | /bin/grep nagios-nsa", + require => File["/etc/init.d/nagios-nsa"], + before => Service['nagios-nsa'], } } + } - nagios_command { - "notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ n.$SERVICEATTEMPT$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; - "host-notify-by-irc": - command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ n.$HOSTATTEMPT$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; - } + nagios_command { + "notify-by-irc": + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($SERVICEDESC$) $NOTIFICATIONTYPE$ n.$SERVICEATTEMPT$ $SERVICESTATETYPE$ $SERVICEEXECUTIONTIME$s $SERVICELATENCY$s $SERVICEOUTPUT$ $SERVICEPERFDATA$"'; + "host-notify-by-irc": + command_line => '/usr/local/bin/riseup-nagios-client.pl "$HOSTNAME$ ($HOSTALIAS$) $NOTIFICATIONTYPE$ n.$HOSTATTEMPT$ $HOSTSTATETYPE$ took $HOSTEXECUTIONTIME$s $HOSTOUTPUT$ $HOSTPERFDATA$ $HOSTLATENCY$s"'; + } - if $use_shorewall { - include shorewall::rules::out::irc - } + if $use_shorewall { + include shorewall::rules::out::irc + } } |