mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-11 19:25:54 +00:00
servicedelegation: Do not fail for not existing members with state absent
Ensuring absence of members (services and targets) that do not exist may not fail as they are not members for servicedelegationtarget and servicedelegationrule. servicedelegation_normalize_principals in ansible_freeipa_module has been extended with a check_exists argument that defaults to False. state == "present" is now given as this argument to turn on the element exists check only if elements should be added.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
- "{{ 'test-service1/' + ansible_facts['fqdn'] }}"
|
||||
- "{{ 'test-service2/' + ansible_facts['fqdn'] }}"
|
||||
- "{{ 'test-service3/' + ansible_facts['fqdn'] }}"
|
||||
- "{{ 'not-existing-test-service/' + ansible_facts['fqdn'] }}"
|
||||
state: absent
|
||||
continue: yes
|
||||
|
||||
@@ -72,6 +73,17 @@
|
||||
register: result
|
||||
failed_when: result.changed or result.failed
|
||||
|
||||
- name: Do not fail to ensure absence of not existing servicedelegationtarget test-delegation-target member principal
|
||||
ipaservicedelegationtarget:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||
name: test-delegation-target
|
||||
principal: "{{ 'not-existing-test-service/' + ansible_facts['fqdn'] }}"
|
||||
action: member
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: result.changed or result.failed
|
||||
|
||||
- name: Ensure servicedelegationtarget test-delegation-target member principal "{{ 'test-service1/' + ansible_facts['fqdn'] }}" is present
|
||||
ipaservicedelegationtarget:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
|
||||
Reference in New Issue
Block a user