Here's what I do. I use generate() to calculate the run times for our jobs
so that each server runs twice per hour at a pseudo-random but consistent
time. I use the IP address of the server, modulo 30.
# Generate the times when the cronjob will run
$cron_time1= generate('/usr/bin/env', 'sh', '-c', "printf $(($(echo
$::ipaddress | awk -F . \'{print \$1+\$2+\$3+\$4}\') % 30))")
$cron_time2 = $cron_time1 + 30
cron { 'puppet-cron':
ensure => present,
command => $puppet_command,
minute => [$cron_time1, $cron_time2],
user => 'root',
}
Hope this helps,
Jeffrey.
On Thu, Mar 8, 2012 at 10:20 AM, Jeeva <[email protected]> wrote:
> We are planning to run the puppet client as a cron rather than running
> as a daemon. Could you please help me in creating a module for running
> the puppet client as a cron
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.