ipareplica/server: Always cleanup root IPA cache

The cleanup of the root IPA cache was depending on the result of the
ipaserver_enable_ipa and ipareplica_enable_ipa tasks. Instead of
"when: something.changed" a handler should be used instead. As
"/root/.ipa_cache" should be removed always (same in command line) the
removal of the file has been moded into the always section and does not
need a when anymore.
This commit is contained in:
Thomas Woerner
2023-03-27 12:24:02 +02:00
parent 64c43c1ec0
commit ec03ad2bf9
2 changed files with 6 additions and 8 deletions

View File

@@ -759,13 +759,12 @@
"{{ result_ipareplica_prepare.config_master_host_name }}"
register: result_ipareplica_enable_ipa
always:
- name: Install - Cleanup root IPA cache
ansible.builtin.file:
path: "/root/.ipa_cache"
state: absent
when: result_ipareplica_enable_ipa.changed
always:
- name: Cleanup temporary files
ansible.builtin.file:
path: "{{ item }}"

View File

@@ -446,12 +446,6 @@
setup_ca: "{{ result_ipaserver_test.setup_ca }}"
register: result_ipaserver_enable_ipa
- name: Install - Cleanup root IPA cache
ansible.builtin.file:
path: "/root/.ipa_cache"
state: absent
when: result_ipaserver_enable_ipa.changed
- name: Install - Configure firewalld
ansible.builtin.command: >
firewall-cmd
@@ -480,6 +474,11 @@
when: ipaserver_setup_firewalld | bool
always:
- name: Install - Cleanup root IPA cache
ansible.builtin.file:
path: "/root/.ipa_cache"
state: absent
- name: Cleanup temporary files
ansible.builtin.file:
path: "{{ item }}"