summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2011-07-14 05:01:09 -0400
committerGabriel Filion <lelutin@gmail.com>2011-07-14 05:01:09 -0400
commitcde75b06b4484f705218c2ef28d49ff545d75f84 (patch)
treef9a4903fe2bcc83fb52299fcc8caf60471772955 /manifests
parente64f3a2fcc19bf6da3f81807531df740c3930657 (diff)
IRC-bot: use 'enable' for Debian
Since the service "disable" bug was fixed in the debian service provider [1] in the puppet 2.6.2-5 package in squeeze, let's switch from the manual calls to the "enable" feature. [1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573551 Also add a requirement between service[nagios-nsa] and file[/etc/init.d/nagios-nsa]. This was ensured in Debian with the exec that we're now replacing but didn't find its way through the centosification.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/irc_bot.pp15
-rw-r--r--manifests/irc_bot/disabled.pp1
2 files changed, 4 insertions, 12 deletions
diff --git a/manifests/irc_bot.pp b/manifests/irc_bot.pp
index 04bed58..494f0c3 100644
--- a/manifests/irc_bot.pp
+++ b/manifests/irc_bot.pp
@@ -57,7 +57,9 @@ class nagios::irc_bot {
service { "nagios-nsa":
ensure => "running",
hasstatus => true,
+ enable => true,
require => [File["/etc/nagios_nsa.cfg"],
+ File["/etc/init.d/nagios-nsa"],
Package["libnet-irc-perl"],
Service['nagios'] ],
}
@@ -65,18 +67,7 @@ class nagios::irc_bot {
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'],
+ name => 'perl-Net-IRC',
}
}
}
diff --git a/manifests/irc_bot/disabled.pp b/manifests/irc_bot/disabled.pp
index 812ef94..83ff15a 100644
--- a/manifests/irc_bot/disabled.pp
+++ b/manifests/irc_bot/disabled.pp
@@ -1,5 +1,6 @@
class nagios::irc_bot::disabled inherits nagios::irc_bot {
Service['nagios-nsa'] {
ensure => stopped,
+ enable => false,
}
}