On Tue,  7 Aug 2012 10:06:32 +0200 (CEST) sauer wrote: 

n> So, I'd like to "repeably randomize" an integer on a host.
n> Specifically, I'd like to use essentially the logic from splayclass or
n> splaytime to pick a time to run a cron job.  "Why not run the job from
n> CFEngine?"  Well, because the job is to check if cf-execd is running,
n> amd I don't want it to fire off on every host at the same time.  But I
n> can't use a random value, because putting a random integer into the
n> crontab wouldn't exactly be convergent.

n> My current idea is to use splayclass to control when I edit crontab,
n> and to just use the current minute (possibly along with whichever of
n> current+30 and current-30 is greater than 0) for the cron job.  But
n> that seems a tad clunky (albeit better than launching a module).
n> Anyone happen to have a suggestion?  I think the more general use case
n> for what I'm looking for is randomint, but with an extra parameter to
n> make it "predictable_randomint". :)

You could take the MAC or IP address mod 60 or whatever granularity you
want.  I've done that in the past and it works all right.

Ted
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to