diff --git a/tasks/common/preflight.yml b/tasks/common/preflight.yml index 1d1fe9e..e603ce1 100644 --- a/tasks/common/preflight.yml +++ b/tasks/common/preflight.yml @@ -1,8 +1,13 @@ --- - name: Check for uninstall signal - ansible.builtin.command: /bin/true - notify: Uninstall units - when: perform_uninstall|bool - changed_when: false + when: perform_uninstall | bool tags: - preflight + block: + - name: Broadcast uninstall signal + ansible.builtin.command: /bin/true + notify: Uninstall units + changed_when: true + + - name: Flush handlers to ensure uninstall is completed + ansible.builtin.meta: flush_handlers diff --git a/tasks/main.yml b/tasks/main.yml index dbae10e..86d0807 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,14 +4,15 @@ tags: - preflight -- name: Include common config tasks - ansible.builtin.include_tasks: "common/config.yml" - when: not perform_uninstall|bool - tags: - - config +- name: Perform setup tasks + when: not perform_uninstall | bool + block: + - name: Include common config tasks + ansible.builtin.include_tasks: "common/config.yml" + tags: + - config -- name: Include common launch tasks - ansible.builtin.include_tasks: "common/launch.yml" - when: not perform_uninstall|bool - tags: - - launch + - name: Include common launch tasks + ansible.builtin.include_tasks: "common/launch.yml" + tags: + - launch