Skip to content

to_uuid

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 2.9.

Synopsis

  • Use to generate namespaced Universal Unique ID.

Parameters

Parameter Defaults / Choices Comments
_input
str
required
String to use as base of 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.