--- /dev/null
+#!/bin/bash -e
+## Run Puppet locally using puppet apply
+/usr/bin/puppet apply /etc/puppetlabs/puppet/manifests/site.pp
+
+## Log status of the Puppet run
+if [ $? -eq 0 ]
+then
+ /usr/bin/logger -i "Puppet has run successfully" -t "puppet-run"
+ exit 0
+else
+ /usr/bin/logger -i "Puppet has ran into an error, please run Puppet manually" -t "puppet-run"
+ exit 1
+fi
+
--- /dev/null
+class cron-puppet {
+ file { 'post-hook':
+ ensure => file,
+ path => '/etc/puppetlabs/puppet/.git/hooks/post-merge',
+ source => 'puppet:///modules/cron-puppet/post-merge',
+ mode => 0755,
+ owner => root,
+ group => root,
+ }
+ cron { 'puppet-apply':
+ ensure => present,
+ command => "cd /etc/puppetlabs/puppet ; /usr/bin/git pull",
+ user => root,
+ minute => '*/30',
+ require => File['post-hook'],
+ }
+}