<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,3 +2,4 @@
 0 * * * *   root    /bin/ps ax | /bin/grep -v grep | /bin/grep -q puppetd || (sleep `echo $RANDOM/2000*60 | bc` &amp;&amp;  /etc/init.d/puppet restart)
 # restart puppet once in a while and randomly delay the restart between 0 and 32 minutes -&gt; splay puppetmaster hammering
 0 22 * * */2   root   sleep `echo $RANDOM/1000*60 | bc` &amp;&amp;  /etc/init.d/puppet restart &gt; /dev/null
+</diff>
      <filename>files/cron.d/puppetd</filename>
    </modified>
    <modified>
      <diff>@@ -2,3 +2,4 @@
 0 * * * *   root    /etc/init.d/puppet status &gt; /dev/null || (sleep `echo $RANDOM/2000*60 | bc` &amp;&amp; /etc/init.d/puppet restart)
 # restart puppet once in a while and randomly delay the restart between 0 and 32 minutes -&gt; splay puppetmaster hammering
 0 22 * * */2   root   sleep `echo $RANDOM/1000*60 | bc` &amp;&amp;  /etc/init.d/puppet restart &gt; /dev/null
+</diff>
      <filename>files/cron.d/puppetd.CentOS</filename>
    </modified>
    <modified>
      <diff>@@ -2,3 +2,4 @@
 # 0 * * * *   root    /bin/ps ax | /bin/grep -v grep | /bin/grep -q puppetd || ( sleep `echo $RANDOM/2000*60 | bc` &amp;&amp; /etc/init.d/puppet restart )
 # restart puppet once in a while and randomly delay the restart between 0 and 32 minutes -&gt; splay puppetmaster hammering
 # 0 22 * * */2   root   sleep `echo $RANDOM/1000*60 | bc` &amp;&amp;  /etc/init.d/puppet restart &gt; /dev/null
+</diff>
      <filename>files/cron.d/puppetd.Gentoo</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,3 @@
 # we restart puppetmaster every 4 hours to avoid memory problems
 0 */6 * * * root /etc/init.d/puppetmaster restart &gt; /dev/null
+</diff>
      <filename>files/cron.d/puppetmaster</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,3 @@
 # we restart puppetmaster every 4 hours to avoid memory problems
-0 */6 * * * root /etc/init.d/puppetmaster restart &gt; /dev/null
+0 */4 * * * root /etc/init.d/puppetmaster restart &gt; /dev/null
+</diff>
      <filename>files/cron.d/puppetmaster.CentOS</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,9 @@
 # modules/puppet/manifests/init.pp - manage puppet stuff
 # original by luke kanies
 # http://github.com/lak
+# adapted by puzzle itc
+# merged with immerda project group's
+# solution
 #
 # Copyright 2008, admin(at)immerda.ch
 # Copyright 2008, Puzzle ITC GmbH
@@ -19,16 +22,21 @@
 
 class puppet {
     case $kernel {
-        linux: { case $operatingsystem {
-                    gentoo:  { include puppet::gentoo }
-                    centos:  { include puppet::centos }
-                    debian:  { include puppet::debian }
-                    default: { include puppet::linux}
-                 }
+        linux: { 
+            case $operatingsystem {
+                gentoo:  { include puppet::gentoo }
+                centos:  { include puppet::centos }
+                debian:  { include puppet::debian }
+                default: { include puppet::linux}
+            }
         }
-        openbsd: { include puppet::openbsd}
+        openbsd: { include puppet::openbsd }
+        default: { include puppet::base }
     }
 
+}
+
+class puppet::base {
     $real_puppet_config = $puppet_config ? {
         '' =&gt; &quot;/etc/puppet/puppet.conf&quot;,
         default =&gt; $puppet_config,
@@ -44,25 +52,28 @@ class puppet {
         notify =&gt; Service[puppet],
         owner =&gt; root, group =&gt; 0, mode =&gt; 600;
     }
+    service{'puppet':
+        ensure =&gt; running,
+        enable =&gt; true,
+        hasstatus =&gt; true,
+        hasrestart =&gt; true,
+        pattern =&gt; puppetd,
+    }
+
 }
 
-class puppet::linux {
+class puppet::linux inherits puppet::base {
     package{ [ 'puppet', 'facter' ]:
         ensure =&gt; present,
     }
 
     # package bc needed for cron
     include bc
-
-    service{'puppet':
-        ensure =&gt; running,
-        enable =&gt; true,
-        hasstatus =&gt; true,
-        hasrestart =&gt; true,
-        pattern =&gt; puppetd,
+    Service['puppet']{
         require =&gt; Package[puppet],
     }
 
+
     file{'/etc/cron.d/puppetd.cron':
         source =&gt; [ &quot;puppet://$server/puppet/cron.d/puppetd.${operatingsystem}&quot;,
                     &quot;puppet://$server/puppet/cron.d/puppetd&quot; ],
@@ -93,6 +104,9 @@ class puppet::debian inherits puppet::linux {
     Service[puppet]{
         hasstatus =&gt; false,
     }
+    File['/etc/cron.d/puppetd.cron']{
+        path =&gt; '/etc/cron.d/puppetd',
+    }
 }
 
 class puppet::centos inherits puppet::linux {
@@ -105,10 +119,26 @@ class puppet::centos inherits puppet::linux {
         owner =&gt; root, group =&gt; 0, mode =&gt; 0644;
     }
 }
-class puppet::openbsd {
-    service{'puppet':
-        provider =&gt; base,
-        pattern =&gt; puppetd,
-        ensure =&gt; running,
+class puppet::openbsd inherits puppet::base {
+    Service['puppet']{
+        restart =&gt; '/bin/kill -HUP `/bin/cat /var/run/puppet/puppetd.pid`',
+        stop =&gt; '/bin/kill `/bin/cat /var/run/puppet/puppetd.pid`',
+        start =&gt; '/usr/local/bin/puppetd',
+        hasstatus =&gt; false,
+        hasrestart =&gt; false,
+    }
+    openbsd::add_to_rc_local{'puppetd':
+        binary =&gt; '/usr/local/bin/puppetd',
+    }
+    cron { 'puppetd_check':
+        command =&gt; '/bin/ps ax | /usr/bin/grep -v grep | /usr/bin/grep -q puppetd || (sleep `echo $RANDOM/2000*60 | bc` &amp;&amp; /usr/local/bin/puppetd)',
+        user =&gt; root,
+        minute =&gt; 0,
     }
+    cron { 'puppetd_restart':
+        command =&gt; 'sleep `echo $RANDOM/2000*60 | bc` &amp;&amp; /bin/kill `/bin/cat /var/run/puppet/puppetd.pid`; /usr/local/bin/puppetd',
+        minute =&gt; 0,
+        hour =&gt; 22,
+        monthday =&gt; '*/2',
+    } 
 }</diff>
      <filename>manifests/init.pp</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,10 @@ class puppet::puppetmaster inherits puppet {
             }
         }
     }
+    include puppet::puppetmaster::base
+}
+
+class puppet::puppetmaster::base inherits puppet::base {
 
     File[puppet_config]{
         source =&gt; [ &quot;puppet://$server/files/puppet/master/puppet.conf&quot;,
@@ -44,6 +48,7 @@ class puppet::puppetmaster inherits puppet {
     }
 }
 
+
 define puppet::puppetmaster::hasdb(
     $dbtype = 'mysql',
     $dbname = 'puppet',</diff>
      <filename>manifests/puppetmaster.pp</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,7 @@
 # manifests/puppetmaster/cluster.pp
 
 class puppet::puppetmaster::cluster inherits puppet::puppetmaster {
-    include mongrel, nginx
-
-    File[puppet_config] {
-        require +&gt; [ Package[mongrel], Package[nginx], File[nginx_config] ],
-    }
+    include puppet::puppetmaster::cluster::base
 
     case $operatingsystem {
         gentoo, centos: {
@@ -16,3 +12,11 @@ class puppet::puppetmaster::cluster inherits puppet::puppetmaster {
         }
     }
 }
+
+class puppet::puppetmaster::cluster::base inherits puppet::puppetmaster::base {
+    include mongrel, nginx
+
+    File[puppet_config] {
+        require +&gt; [ Package[mongrel], Package[nginx], File[nginx_config] ],
+    }
+}</diff>
      <filename>manifests/puppetmaster/cluster.pp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7c3b123c815be28c71f1a8dd14d2b7e478807e7b</id>
    </parent>
    <parent>
      <id>45afa4134bc07ec1eb32d0d20a3990055f4eb499</id>
    </parent>
  </parents>
  <author>
    <name>Marcel Haerry</name>
    <email>haerry@puzzle.ch</email>
  </author>
  <url>http://github.com/puzzle/puppet-puppet/commit/841eb14d7da2eb42b4ed000fd0ea9bae5c9f7e2c</url>
  <id>841eb14d7da2eb42b4ed000fd0ea9bae5c9f7e2c</id>
  <committed-date>2008-11-04T08:43:09-08:00</committed-date>
  <authored-date>2008-11-04T08:43:09-08:00</authored-date>
  <message>merged with immerda</message>
  <tree>3711f25506c6ca77d90767e74f6e932b5bcbc17c</tree>
  <committer>
    <name>Marcel Haerry</name>
    <email>haerry@puzzle.ch</email>
  </committer>
</commit>
