It seems the pull request to add a random filter never quite got merged in just yet, because I think it got over-wraught with a user’s particular use case for using it with a given module in cron (thus making it confusing), but I think this should be a filter and is easy to do.
There’s no real reason to key it off a fqdn, I think that’s a bit overthought. Repeatable randomness isn’t, in that case, you might as well just use the index number of the host you are looping over.
I’d like to see it something like this
{{ 25 | random_int }}
To generate a number between 0 and 25.
also
{{ 25 | random_float }}
Pull requests would be accepted!
There is of course already the “with_random_choice” lookup plugin: