mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 21:01:27 -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
|
@ -131,6 +131,11 @@ class TestFilters(unittest.TestCase):
|
|||
'a\\1')
|
||||
assert a == 'ansible'
|
||||
|
||||
def test_to_uuid(self):
|
||||
a = ansible.runner.filter_plugins.core.to_uuid('example.com')
|
||||
|
||||
assert a == 'ae780c3a-a3ab-53c2-bfb4-098da300b3fe'
|
||||
|
||||
#def test_filters(self):
|
||||
|
||||
# this test is pretty low level using a playbook, hence I am disabling it for now -- MPD.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue