Skip to content

Commit

Permalink
Fix incorrect examples with random filter (ansible#50137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Lihachev authored and dagwieers committed Dec 19, 2018
1 parent cc8e903 commit 9a7dbd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docsite/rst/user_guide/playbooks_filters.rst
Expand Up @@ -395,7 +395,7 @@ To get a random item from a list::

To get a random number between 0 and a specified number::

"{{ 60 | random }} * * * * root /script/from/cron"
"{{ 59 | random }} * * * * root /script/from/cron"
# => '21 * * * * root /script/from/cron'

Get a random number from 0 to 100 but in steps of 10::
Expand All @@ -412,7 +412,7 @@ Get a random number from 1 to 100 but in steps of 10::

As of Ansible version 2.3, it's also possible to initialize the random number generator from a seed. This way, you can create random-but-idempotent numbers::

"{{ 60 | random(seed=inventory_hostname) }} * * * * root /script/from/cron"
"{{ 59 | random(seed=inventory_hostname) }} * * * * root /script/from/cron"


Shuffle Filter
Expand Down

0 comments on commit 9a7dbd5

Please sign in to comment.