mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-20 07:59:10 -07:00
Add seed parameter to random_mac filter (#51841)
This commit is contained in:
parent
a910d19533
commit
730456b402
3 changed files with 17 additions and 3 deletions
|
@ -378,6 +378,10 @@ To get a random MAC address from a string prefix starting with '52:54:00'::
|
|||
|
||||
Note that if anything is wrong with the prefix string, the filter will issue an error.
|
||||
|
||||
As of Ansible version 2.9, it's also possible to initialize the random number generator from a seed. This way, you can create random-but-idempotent MAC addresses::
|
||||
|
||||
"{{ '52:54:00' | random_mac(seed=inventory_hostname) }}"
|
||||
|
||||
.. _random_filter:
|
||||
|
||||
Random Number Filter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue