X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fmonit%2Fmanifests%2Finit.pp;h=7792b086f0b55a619942500bfc9f4085a4119bd2;hb=7a667efa6072713f4b24f163180597965aacb5b1;hp=a3b92820ee3cf9ae2a1675de4dbe9532aeb28793;hpb=32ed1d575838c74dc2f6f94eda68d9ab5b3e7b0e;p=mirror%2Fdsa-puppet.git diff --git a/modules/monit/manifests/init.pp b/modules/monit/manifests/init.pp index a3b92820e..7792b086f 100644 --- a/modules/monit/manifests/init.pp +++ b/modules/monit/manifests/init.pp @@ -1,17 +1,42 @@ class monit { - package { "monit": ensure => installed; + package { "monit": ensure => installed } + + $cmd = $::lsbdistcodename ? { + 'sid' => '/usr/bin/monit', + 'wheezy' => '/usr/bin/monit', + default => '/usr/sbin/monit', + } + + augeas { "inittab": + context => "/files/etc/inittab", + changes => [ "set mo/runlevels 2345", + "set mo/action respawn", + "set mo/process \"$cmd -d 300 -I -c /etc/monit/monitrc -s /var/lib/monit/monit.state\"", + ], + notify => Exec["init q"], } file { + #"/etc/rc2.d/K99monit": + # ensure => "../init.d/monit"; + #"/etc/rc2.d/S99monit": + # ensure => absent; + + "/etc/monit/": + ensure => directory, + owner => root, + group => root, + mode => 755, + purge => true + ; + "/etc/monit/monitrc": - source => "puppet:///monit/monitrc", + content => template("monit/monitrc.erb"), require => Package["monit"], - notify => Exec["monit restart"] - mode => 440, + notify => Exec["monit stop"], + mode => 400 ; - } - file { "/etc/monit/monit.d": ensure => directory, owner => root, @@ -19,36 +44,33 @@ class monit { mode => 750, purge => true ; - } - file { "/etc/monit/monit.d/01puppet": - source => "puppet:///monit/puppet", + source => "puppet:///modules/monit/puppet", require => Package["monit"], - notify => Exec["monit restart"] - mode => 440, + notify => Exec["monit stop"], + mode => 440 ; - } - file { "/etc/monit/monit.d/00debian.org": - source => "puppet:///monit/debianorg", + source => "puppet:///modules/monit/debianorg", require => Package["monit"], - notify => Exec["monit restart"] - mode => 440, + notify => Exec["monit stop"], + mode => 440 ; - } - file { "/etc/default/monit": - source => "puppet:///monit/default", + content => template("monit/default.erb"), require => Package["monit"], - notify => Exec["monit restart"] + notify => Exec["monit stop"] ; } - exec { "monit restart": + exec { "monit stop": path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", refreshonly => true, } } +# vim:set et: +# vim:set sts=4 ts=4: +# vim:set shiftwidth=4: