mirror of https://github.com/ansible/ansible.git
* check run state of current block only
* Add changelog and test
* Add test for issue 29047
(cherry picked from commit f2f6c34632
)
pull/71527/head
parent
b6c7598a20
commit
f563365f8e
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- Fix statistics reporting when rescue block contains another block (issue https://github.com/ansible/ansible/issues/61253).
|
@ -0,0 +1,33 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- block:
|
||||
- name: "EXPECTED FAILURE"
|
||||
fail:
|
||||
msg: "fail to test single level block in rescue"
|
||||
rescue:
|
||||
- block:
|
||||
- debug:
|
||||
msg: Rescued!
|
||||
|
||||
- block:
|
||||
- name: "EXPECTED FAILURE"
|
||||
fail:
|
||||
msg: "fail to test multi-level block in rescue"
|
||||
rescue:
|
||||
- block:
|
||||
- block:
|
||||
- debug:
|
||||
msg: Rescued!
|
||||
|
||||
- name: "Outer block"
|
||||
block:
|
||||
- name: "Inner block"
|
||||
block:
|
||||
- name: "EXPECTED FAILURE"
|
||||
fail:
|
||||
msg: "fail to test multi-level block"
|
||||
rescue:
|
||||
- name: "Rescue block"
|
||||
block:
|
||||
- debug: msg="Inner block rescue"
|
@ -0,0 +1,4 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- include_tasks: issue29047_tasks.yml
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: "EXPECTED FAILURE"
|
||||
block:
|
||||
- fail:
|
||||
msg: "EXPECTED FAILURE"
|
||||
rescue:
|
||||
- name: Assert that ansible_failed_task is defined
|
||||
assert:
|
||||
that: ansible_failed_task is defined
|
||||
|
||||
- name: Assert that ansible_failed_result is defined
|
||||
assert:
|
||||
that: ansible_failed_result is defined
|
Loading…
Reference in New Issue