From 1d394503673207cf6c35ba8d294a05d50287d35e Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Fri, 12 Apr 2024 17:40:31 +0200 Subject: [PATCH] Fail if in a rescue block --- tests/tasks/assert_fail_on_s390x.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/tasks/assert_fail_on_s390x.yml b/tests/tasks/assert_fail_on_s390x.yml index 591c858..16116a8 100644 --- a/tests/tasks/assert_fail_on_s390x.yml +++ b/tests/tasks/assert_fail_on_s390x.yml @@ -11,3 +11,9 @@ - name: End execution on s390x host to avoid failures in clean up meta: end_host + +# When this task file is included in a rescue block, and the above task is +# skipped, Ansible would report success considering that a failure was rescued +- name: Fail if in a rescue block + when: ansible_failed_result is defined + fail: