# question? is there an equivalent to fqdn\_rand?

**URL:** <https://forum.ansible.com/t/question-is-there-an-equivalent-to-fqdn-rand/14437>\
**Category:** Ansible Developer\
**Tags:** ansible-devel\
**Created:** [January 27, 2014, 9:22pm UTC](https://forum.ansible.com/t/question-is-there-an-equivalent-to-fqdn-rand/14437 "2014-01-27T21:22:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [January 27, 2014, 9:22pm UTC](https://forum.ansible.com/t/question-is-there-an-equivalent-to-fqdn-rand/14437/1 "2014-01-27T21:22:49Z")

</div>

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:

[http://docs.ansible.com/playbooks\_loops.html#id16](http://docs.ansible.com/playbooks_loops.html#id16)
