Skip to content

Instantly share code, notes, and snippets.

@bionix
Created October 6, 2013 17:43
Show Gist options
  • Save bionix/6856917 to your computer and use it in GitHub Desktop.
Save bionix/6856917 to your computer and use it in GitHub Desktop.
A puppet cron job snippet for a poll cron task for puppet runs
# establishes a cron entry that runs the puppet agent every 30 minutes, starting
# at a time that is derived from the primary ip-address
# largely based on http://projects.puppetlabs.com/projects/1/wiki/Cron_Patterns
$timeoffset1 = ip_to_cron(1,29)
$timeoffset2 = $timeoffset1 + 30
cron { "puppet":
ensure => present,
command => "puppet agent --onetime --no-daemonize --environment ${environment} --fqdn ${hostname}.${dnsdomain} --logdest syslog > /dev/null 2>&1",
user => "root",
minute => [ $timeoffset1, $timeoffset2 ],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment