On 07/01/2012 11:53, no-re...@cfengine.com wrote:
> Forum: CFEngine Help
> Subject: Re: Using dist for random selections
> Author: sauer
> Link to topic: https://cfengine.com/forum/read.php?3,24500,24505#msg-24505
>
> You noticed that you have more than 10 outputs there, right? I wonder if 
> rand's value is remaining constant or being redefined in subsequent 
> iterations. So sometimes you're getting both heads and tails. :)
>
> Sounds like there might be a feature request asking for randomint to only be 
> "random" once per promise, and to remain constant through subsequent 
> iterations. Perhaps that can use the same logic I need in the 
> get_host_by_name dns lookup function so it'll return the same value every 
> time it's called. :)
>
>

Maybe you could use "select_class" to define a class from a list, based 
on the host name.
It will be constant over all execution, so it's a bit more than what you 
request, but to random over nodes it would do the trick

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

Reply via email to