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:
Björn Andersson 2015-01-21 06:09:22 +08:00
commit 65e4f2b2bc
3 changed files with 18 additions and 0 deletions

View file

@ -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::