X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fmonit%2Fmanifests%2Finit.pp;h=8b9880ff4cfd82b939db4a204db71d1ef885c07a;hb=61b1f29e849df28f2892efc5f98318611e99eeeb;hp=5e8da8c81937d1d22f5075e385dda7d29f77d806;hpb=5f9b6e60800eeff29318662b84404dc0d23283dc;p=dsa-puppet.git diff --git a/modules/monit/manifests/init.pp b/modules/monit/manifests/init.pp index 5e8da8c8..8b9880ff 100644 --- a/modules/monit/manifests/init.pp +++ b/modules/monit/manifests/init.pp @@ -1,72 +1,68 @@ +# = Class: monit +# +# This class installs and configures monit +# +# == Sample Usage: +# +# include monit +# class monit { - 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"], - } + package { 'monit': + ensure => installed + } + $cmd = $::lsbdistcodename ? { + 'sid' => '/usr/bin/monit', + 'wheezy' => '/usr/bin/monit', + default => '/usr/sbin/monit', + } - file { - #"/etc/rc2.d/K99monit": - # ensure => "../init.d/monit"; - #"/etc/rc2.d/S99monit": - # ensure => absent; + 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'], + } - "/etc/monit/": - ensure => directory, - owner => root, - group => root, - mode => 755, - purge => true - ; + file { '/etc/monit/': + ensure => directory, + owner => root, + group => root, + mode => '0755', + purge => true, + notify => Exec['monit stop'], + require => Package['monit'], + } + file { '/etc/monit/monit.d': + ensure => directory, + owner => root, + group => root, + mode => '0750', + purge => true, + } + file { '/etc/monit/monitrc': + content => template('monit/monitrc.erb'), + mode => '0400' + } + file { '/etc/monit/monit.d/01puppet': + source => 'puppet:///modules/monit/puppet', + mode => '0440' + } + file { '/etc/monit/monit.d/00debian.org': + source => 'puppet:///modules/monit/debianorg', + mode => '0440' + } + file { '/etc/default/monit': + content => template('monit/default.erb'), + require => Package['monit'], + notify => Exec['monit stop'] + } - "/etc/monit/monitrc": - content => template("monit/monitrc.erb"), - require => Package["monit"], - notify => Exec["monit stop"], - mode => 400 - ; - - "/etc/monit/monit.d": - ensure => directory, - owner => root, - group => root, - mode => 750, - purge => true - ; - - "/etc/monit/monit.d/01puppet": - source => "puppet:///modules/monit/puppet", - require => Package["monit"], - notify => Exec["monit stop"], - mode => 440 - ; - - "/etc/monit/monit.d/00debian.org": - source => "puppet:///modules/monit/debianorg", - require => Package["monit"], - notify => Exec["monit stop"], - mode => 440 - ; - - "/etc/default/monit": - content => template("monit/default.erb"), - require => Package["monit"], - notify => Exec["monit stop"] - ; - } - exec { "monit stop": - path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", - refreshonly => true, - } + 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: