summaryrefslogtreecommitdiff
path: root/manifests/openbsd.pp
blob: 7427a86a91406e32819fc9b4327052bc2d0d187b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class puppet::openbsd inherits puppet::base {
  Service['puppet']{
    restart => '/bin/kill -HUP `/bin/cat /var/run/puppet/puppetd.pid`',
    stop => '/bin/kill `/bin/cat /var/run/puppet/puppetd.pid`',
    start => '/usr/local/bin/puppetd',
    hasstatus => false,
    hasrestart => false,
  }
  openbsd::rc_local{'puppetd':
    binary => '/usr/local/bin/puppetd',
  }
  cron { 'puppetd_check':
    command => '/bin/ps ax | /usr/bin/grep -v grep | /usr/bin/grep -q puppetd || (sleep `echo $RANDOM/2000*60 | bc` && /usr/local/bin/puppetd)',
    user => root,
    minute => 0,
  }
  cron { 'puppetd_restart':
    command => 'sleep `echo $RANDOM/2000*60 | bc` && /bin/kill `/bin/cat /var/run/puppet/puppetd.pid`; /usr/local/bin/puppetd',
    minute => 0,
    hour => 22,
    monthday => '*/2',
  } 
}