mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Add filter to turn a string into a UUID
This filter was made because I needed to create idempotent UUIDs when installing the agent for Go (http://go.cd), which uses UUIds to distinguish the agents from each other. It uses a newly created Ansible namespace to distinguish UUIDs created by Ansible from any other source. The new namespace is a random one created by uuidgen on OSX.
This commit is contained in:
parent
2a04663255
commit
65e4f2b2bc
3 changed files with 18 additions and 0 deletions
|
@ -409,6 +409,10 @@ To work with Base64 encoded strings::
|
|||
{{ encoded | b64decode }}
|
||||
{{ decoded | b64encode }}
|
||||
|
||||
To create a UUID from a string (new in version 1.9)::
|
||||
|
||||
{{ hostname | to_uuid }}
|
||||
|
||||
To cast values as certain types, such as when you input a string as "True" from a vars_prompt and the system
|
||||
doesn't know it is a boolean value::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue