mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00: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:
@@ -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::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user