]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/monit/manifests/init.pp
06f71a0ade5f71ad0f47080f068f7ba5dc0c7938
[dsa-puppet.git] / modules / monit / manifests / init.pp
1 class monit {
2     package { "monit": ensure => installed }
3
4     augeas { "inittab":
5         context => "/files/etc/inittab",
6         changes => [ "set mo/runlevels 2345",
7                      "set mo/action respawn",
8                      "set mo/process \"/usr/sbin/monit -d 300 -I -c /etc/monit/monitrc -s /var/lib/monit/monit.state\"",
9                    ],
10         onlyif => "match mo size == 0",
11         notify => Exec["init q"],
12     }
13
14
15     file {
16         #"/etc/rc2.d/K99monit":
17         #  ensure  => "../init.d/monit";
18         #"/etc/rc2.d/S99monit":
19         #  ensure  => absent;
20
21         "/etc/monit/":
22           ensure  => directory,
23           owner   => root,
24           group   => root,
25           mode    => 755,
26           purge   => true
27           ;
28
29         "/etc/monit/monitrc":
30           content => template("monit/monitrc.erb"),
31           require => Package["monit"],
32           notify  => Exec["monit stop"],
33           mode    => 400
34           ;
35
36         "/etc/monit/monit.d":
37           ensure  => directory,
38           owner   => root,
39           group   => root,
40           mode    => 750,
41           purge   => true
42           ;
43
44         "/etc/monit/monit.d/01puppet":
45           source  => "puppet:///monit/puppet",
46           require => Package["monit"],
47           notify  => Exec["monit stop"],
48           mode    => 440
49           ;
50
51         "/etc/monit/monit.d/00debian.org":
52           source  => "puppet:///monit/debianorg",
53           require => Package["monit"],
54           notify  => Exec["monit stop"],
55           mode    => 440
56           ;
57
58         "/etc/default/monit":
59           content => template("monit/default.erb"),
60           require => Package["monit"],
61           notify  => Exec["monit stop"]
62           ;
63     }
64     exec { "monit stop":
65         path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
66         refreshonly => true,
67     }
68 }
69
70 # vim:set et:
71 # vim:set sts=4 ts=4:
72 # vim:set shiftwidth=4: