Depending on how you are doing it, you could use:
exec "randno" {
creates => "/tmp/foo",
}
Let me guess, you are trying to get cron to run at a random but
consistent time, yes?
>From what I've read (haven't tried it myself yet) the best way is to
map the number from
a consistent thing about the host... Maybe get the last octet from the
IP address of the
node and do an IP % 60 perhaps... Its not random, but it does spread
out a cron job over
the hour...
Since its on my todo list as well, I haven't got an example of exactly
how to do this
to show you unfortunately...
Greg
On Aug 12, 8:03 am, Peter Meier <[email protected]> wrote:
> Hi
>
> > I would like to have puppet manage a file on each client. The file is
> > the same for all clients, but has two random numbers in it.
>
> > I assume I can use something like fqdn_rand(0-59) to generate a random
> > number between 0 and 59, right?
>
> > My main question is how to I get puppet to not think the file is
> > different every time puppetd runs? Would I use a template or a file
> > def and contents?
>
> neither will help. either you make your random function depending on a
> seed, which means it isn't really random anymore. Or if you create the
> file, replace => false might be your friend. But then for sure if you
> change your other content it won't adjust them as well.
>
> cheers pete
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---