to_uuid¶
Collection Note
This module is part of the ansible.builtin collection. To install the collection, use:
Added in version2.9.
Synopsis¶
- Use to generate namespaced Universal Unique ID.
Parameters¶
| Parameter | Defaults / Choices | Comments |
|---|---|---|
| _input str required |
String to use as base fo the UUID. | |
| namespace str |
Default: 361E6D51-FAEC-444A-9079-341386DA8E2E |
UUID namespace to use. |
Examples¶
# To create a namespaced UUIDv5
uuid: "{{ string | to_uuid(namespace='11111111-2222-3333-4444-555555555555') }}"
# To create a namespaced UUIDv5 using the default Ansible namespace '361E6D51-FAEC-444A-9079-341386DA8E2E'
uuid: "{{ string | to_uuid }}"
Return Values¶
| Key | Data Type | Description | Returned |
|---|---|---|---|
| _value | string | Generated UUID. |