mirror of https://github.com/ansible/ansible.git
Propagate ansible_failed_task to an outer rescue (#78676)
Fixes #43191 Fixes #72638 Fixes #78042 Co-authored-by: Sandra McCann <samccann@redhat.com>pull/78720/head
parent
848143640b
commit
fd19ff2310
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- Propagate ``ansible_failed_task`` and ``ansible_failed_result`` to an outer rescue (https://github.com/ansible/ansible/issues/43191)
|
@ -0,0 +1,17 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- block:
|
||||||
|
- name: EXPECTED FAILURE
|
||||||
|
fail:
|
||||||
|
always:
|
||||||
|
- block:
|
||||||
|
- debug:
|
||||||
|
always:
|
||||||
|
- debug:
|
||||||
|
rescue:
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- ansible_failed_task is defined
|
||||||
|
- ansible_failed_result is defined
|
@ -0,0 +1,18 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- block:
|
||||||
|
- name: EXPECTED FAILURE
|
||||||
|
fail:
|
||||||
|
always:
|
||||||
|
- block:
|
||||||
|
- block:
|
||||||
|
- debug:
|
||||||
|
rescue:
|
||||||
|
- block:
|
||||||
|
- block:
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- ansible_failed_task is defined
|
||||||
|
- ansible_failed_result is defined
|
Loading…
Reference in New Issue