From: Oleg Broytman Date: Sun, 21 Jul 2019 14:14:26 +0000 (+0300) Subject: Fix: Use `failed_when` instead of `ignore_errors` X-Git-Url: https://git.phdru.name/?p=ansible.git;a=commitdiff_plain;h=4ddac78094546713d0e96f88932a0a9cfd1432ae Fix: Use `failed_when` instead of `ignore_errors` --- diff --git a/playbooks/ansible/cleanup-tmp.yml b/playbooks/ansible/cleanup-tmp.yml index 2b46a32..8140c85 100644 --- a/playbooks/ansible/cleanup-tmp.yml +++ b/playbooks/ansible/cleanup-tmp.yml @@ -6,4 +6,4 @@ command: "rm -rf ~/.ansible/tmp/*" args: warn: false - ignore_errors: true + failed_when: false diff --git a/playbooks/debian/roles/phd/tasks/main.yml b/playbooks/debian/roles/phd/tasks/main.yml index 455605f..9897304 100644 --- a/playbooks/debian/roles/phd/tasks/main.yml +++ b/playbooks/debian/roles/phd/tasks/main.yml @@ -1,6 +1,6 @@ - name: Test if user phd already exists command: test -f ~/.profile -a -f ~/.shellrc - ignore_errors: true + failed_when: false register: phd_exist - debug: diff --git a/playbooks/roles/debian/remove-systemd/tasks/main.yml b/playbooks/roles/debian/remove-systemd/tasks/main.yml index f0dd1d6..2c7b909 100644 --- a/playbooks/roles/debian/remove-systemd/tasks/main.yml +++ b/playbooks/roles/debian/remove-systemd/tasks/main.yml @@ -31,7 +31,6 @@ - name: Purge SystemD become: true import_tasks: remove-systemd.yml - ignore_errors: true - name: Reboot if SystemD is still active become: true diff --git a/playbooks/roles/debian/remove-systemd/tasks/remove-systemd.yml b/playbooks/roles/debian/remove-systemd/tasks/remove-systemd.yml index dbc493d..13b0488 100644 --- a/playbooks/roles/debian/remove-systemd/tasks/remove-systemd.yml +++ b/playbooks/roles/debian/remove-systemd/tasks/remove-systemd.yml @@ -8,4 +8,5 @@ purge: yes state: absent update_cache: no + failed_when: false register: purged