Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filters: Add a note about seed #74863

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/docsite/rst/user_guide/playbooks_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,10 @@ You can initialize the random number generator from a seed to create random-but-

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

.. note::

While using ``seed`` parameter, the resulting value can be different depending on the version of Python used on the Ansible controller.

Shuffling a list
----------------

Expand All @@ -894,6 +898,9 @@ You can initialize the shuffle generator from a seed to generate a random-but-id

The shuffle filter returns a list whenever possible. If you use it with a non 'listable' item, the filter does nothing.

.. note::

While using ``seed`` parameter, the resulting value can be different depending on the version of Python used on the Ansible controller.

.. _list_filters:

Expand Down Expand Up @@ -1328,6 +1335,10 @@ An idempotent method to generate unique hashes per system is to use a salt that

Hash types available depend on the control system running Ansible, 'hash' depends on `hashlib <https://docs.python.org/3.8/library/hashlib.html>`_, password_hash depends on `passlib <https://passlib.readthedocs.io/en/stable/lib/passlib.hash.html>`_. The `crypt <https://docs.python.org/3.8/library/crypt.html>`_ is used as a fallback if ``passlib`` is not installed.

.. note::

While using ``seed`` parameter, the resulting value can be different depending on the version of Python used on the Ansible controller.

.. versionadded:: 2.7

Some hash types allow providing a rounds parameter::
Expand Down