>
> Right. But with a caveat: the random number is not really random. In
> fact the random generator is seeded with the node fqdn. Since this is a
> constant, the generated random number won't change from run to run for a
> given node.
>
>
> Or if you want to manage cron resource directly:
>
> cron {
> "mycron":
> command => "/usr/local/bin/backup-logical",
> hour => '*',
> minute => fqdn_rand(60),
> }
>
Another *helpful tip* is to add an additional *SEED* to 'fqdn_rand' so that
each subsequent cron job managed with puppet (each with a unique name) is
stagger within the hour.
Usage: fqdn_rand(MAX, [SEED]). MAX is required and must be a positive
> integer; SEED is optional and may be any number or string.
cron { "manual-puppet":
command => "/usr/bin/puppet apply --modulepath=/Net/puppet/modules
/Net/puppet/manifests/site.pp",
user => root,
hour => '*',
minute => fqdn_rand(60, $name),
ensure => present,
}
Without the "*$name*" SEED, each cron job using 'fqdn_rand(60)' to
randomize the minute would run at the exact same time on a given server.
Now our multiple cron jobs are randomly distributed with the added SEED
value.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/8010ea28-a75b-4683-b15c-536cd2013162%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.