X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fmonit%2Fmanifests%2Finit.pp;h=1fcbf898f727a33725faf2366c644a916e82755c;hb=302bfadeb2245517c64c144426a5a7f387d11397;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..1fcbf898f 100644 --- a/modules/monit/manifests/init.pp +++ b/modules/monit/manifests/init.pp @@ -1,17 +1,39 @@ 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 +41,33 @@ class monit { mode => 750, purge => true ; - } - file { "/etc/monit/monit.d/01puppet": source => "puppet:///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", 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: