]> gitweb.fluxo.info Git - puppet-puppet.git/commitdiff
Puppet restart cronjob needs bash to use $RANDOM
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 21 Feb 2011 17:41:39 +0000 (14:41 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 21 Feb 2011 17:41:39 +0000 (14:41 -0300)
files/cron.d/puppetd
manifests/puppetd.pp
manifests/puppetmasterd.pp

index 2cb9acfb39e7aa8fa722b46e2918444e83a41e56..3e356ae3e131bcb73d39f9b41f2746d7a2593c91 100644 (file)
@@ -1,2 +1,2 @@
 # restart puppet once in a while and randomly delay the restart between 0 and 32 minutes -> splay puppetmaster hammering
-0 22 * * */2   root   sleep `echo $RANDOM/1000*60 | bc` &&  /etc/init.d/puppet restart > /dev/null
+0 22 * * */2   root /bin/bash -c "sleep `echo $RANDOM/1000*60 | bc` &&  /etc/init.d/puppet restart" > /dev/null
index 7f0024135915b14acf59dfd18710b6fe60e797cc..f2c6680494b66955483cc8737f1a7d507ca516e4 100644 (file)
@@ -75,6 +75,7 @@ class puppetd inherits puppet {
     ensure   => present,
   }
 
+  # thanks to https://labs.riseup.net/code/projects/shared-puppet
   file { "/etc/cron.d/puppetd":
     source => "puppet://$server/modules/puppet/cron.d/puppetd",
     owner  => root,
index 67ec4b4911300fe3bbfd9cdc50b0e5414d752e8b..c8ccc7aa3444aa6678911000509184cef5c0c6ed 100644 (file)
@@ -107,6 +107,7 @@ class puppetmasterd {
   }
 
   # restart the master from time to time to avoid memory problems
+  # thanks to https://labs.riseup.net/code/projects/shared-puppet
   file { "/etc/cron.d/puppetmaster":
     source => "puppet://$server/modules/puppet/cron.d/puppetmaster",
     owner  => root,