]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/monit/manifests/init.pp
move all files to explicit new-style module/ paths
[dsa-puppet.git] / modules / monit / manifests / init.pp
index 5e1ebe084d058c69198ec661ba8f593ed0ba5765..5e8da8c81937d1d22f5075e385dda7d29f77d806 100644 (file)
@@ -1,7 +1,23 @@
 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"],
+    }
+
+
     file {
+        #"/etc/rc2.d/K99monit":
+        #  ensure  => "../init.d/monit";
+        #"/etc/rc2.d/S99monit":
+        #  ensure  => absent;
+
         "/etc/monit/":
           ensure  => directory,
           owner   => root,
@@ -11,9 +27,9 @@ class monit {
           ;
 
         "/etc/monit/monitrc":
-          source  => "puppet:///monit/monitrc",
+          content => template("monit/monitrc.erb"),
           require => Package["monit"],
-          notify  => Exec["monit restart"],
+          notify  => Exec["monit stop"],
           mode    => 400
           ;
 
@@ -26,28 +42,31 @@ class monit {
           ;
 
         "/etc/monit/monit.d/01puppet":
-          source  => "puppet:///monit/puppet",
+          source  => "puppet:///modules/monit/puppet",
           require => Package["monit"],
-          notify  => Exec["monit restart"],
+          notify  => Exec["monit stop"],
           mode    => 440
           ;
 
         "/etc/monit/monit.d/00debian.org":
-          source  => "puppet:///monit/debianorg",
+          source  => "puppet:///modules/monit/debianorg",
           require => Package["monit"],
-          notify  => Exec["monit restart"],
+          notify  => Exec["monit stop"],
           mode    => 440
           ;
 
         "/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: