Skip to content

Instantly share code, notes, and snippets.

@sheldonh
Created June 10, 2009 08:51
Show Gist options
  • Select an option

  • Save sheldonh/127104 to your computer and use it in GitHub Desktop.

Select an option

Save sheldonh/127104 to your computer and use it in GitHub Desktop.
# manifests/classes/puppetmaster.rb
class puppetmaster {
$branch = $fqdn ? {
'puppet1.hetzner.africa' => 'trunk',
default => 'branches/production',
}
cron { puppetmaster_clean_reports:
ensure => absent,
user => puppet,
command => "find /var/lib/puppetmaster/reports/ -type f -mtime +14 -print0 | xargs --no-run-if-empty -0 rm -f",
minute => 0,
}
file { "/usr/local/hetzner/bin/puppet-svn-update":
ensure => file,
owner => root,
group => root,
mode => 755,
source => "puppet://$server/files//usr/local/hetzner/bin/puppet-svn-update",
}
file { "/etc/cron.d/puppet":
ensure => file,
owner => root,
group => root,
mode => 644,
content => template("cron.d-puppet.erb"),
}
}
# templates/cron.d-puppet.erb
[email protected]
*/15 6-14 * * 1-5 root /usr/local/hetzner/bin/puppet-svn-update <%= branch %>
0 1 * * * puppet find /var/lib/puppetmaster/reports/ -type f -mtime +14 -print0 | xargs --no-run-if-empty -0 rm -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment