X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fmonit%2Fmanifests%2Finit.pp;h=5e8da8c81937d1d22f5075e385dda7d29f77d806;hb=58d1f77e7d007f4f72bba93925f3361475ca4079;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..5e8da8c81 100644 --- a/modules/monit/manifests/init.pp +++ b/modules/monit/manifests/init.pp @@ -1,17 +1,38 @@ class monit { - package { "monit": ensure => installed; + package { "monit": ensure => installed } + + augeas { "inittab": + context => "/files/etc/inittab", + changes => [ "set mo/runlevels 2345", + "set mo/action respawn", + "set mo/process \"/usr/sbin/monit -d 300 -I -c /etc/monit/monitrc -s /var/lib/monit/monit.state\"", + ], + onlyif => "match mo size == 0", + 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 +40,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: