quote link target
[mirror/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
19         "/etc/rc2.d/S99monit":
20           ensure  => absent;
21
22         "/etc/monit/":
23           ensure  => directory,
24           owner   => root,
25           group   => root,
26           mode    => 755,
27           purge   => true
28           ;
29
30         "/etc/monit/monitrc":
31           content => template("monit/monitrc.erb"),
32           require => Package["monit"],
33           notify  => Exec["monit stop"],
34           mode    => 400
35           ;
36
37         "/etc/monit/monit.d":
38           ensure  => directory,
39           owner   => root,
40           group   => root,
41           mode    => 750,
42           purge   => true
43           ;
44
45         "/etc/monit/monit.d/01puppet":
46           source  => "puppet:///monit/puppet",
47           require => Package["monit"],
48           notify  => Exec["monit stop"],
49           mode    => 440
50           ;
51
52         "/etc/monit/monit.d/00debian.org":
53           source  => "puppet:///monit/debianorg",
54           require => Package["monit"],
55           notify  => Exec["monit stop"],
56           mode    => 440
57           ;
58
59         "/etc/default/monit":
60           content => template("monit/default.erb"),
61           require => Package["monit"],
62           notify  => Exec["monit stop"]
63           ;
64     }
65     exec { "monit stop":
66         path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
67         refreshonly => true,
68     }
69 }
70
71 # vim:set et:
72 # vim:set sts=4 ts=4:
73 # vim:set shiftwidth=4: