mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 20:44:16 +03:00
Fix roles/policies normalization in consul_token. (#9845)
* Fix roles/policies normalization in consul_token. * Update changelogs/fragments/9845-consul_token_idempotency.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
eff25c8a6e
commit
7d5357d74c
2
changelogs/fragments/9845-consul_token_idempotency.yml
Normal file
2
changelogs/fragments/9845-consul_token_idempotency.yml
Normal file
@ -0,0 +1,2 @@
|
||||
minor_changes:
|
||||
- consul_token - fix idempotency when ``policies`` or ``roles`` are supplied by name (https://github.com/ansible-collections/community.general/issues/9841, https://github.com/ansible-collections/community.general/pull/9845).
|
@ -220,7 +220,7 @@ def normalize_link_obj(api_obj, module_obj, key):
|
||||
|
||||
for obj in module_objs:
|
||||
identifier = obj.get("ID")
|
||||
name = obj.get("Name)")
|
||||
name = obj.get("Name")
|
||||
if identifier and not name and identifier in id_to_name:
|
||||
obj["Name"] = id_to_name[identifier]
|
||||
if not identifier and name and name in name_to_id:
|
||||
|
@ -67,7 +67,7 @@
|
||||
state: present
|
||||
accessor_id: 07a7de84-c9c7-448a-99cc-beaf682efd21
|
||||
policies:
|
||||
- id: "{{ create_result.token.Policies[-1].ID }}"
|
||||
- name: foo-access2
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
Loading…
x
Reference in New Issue
Block a user