mirror of https://github.com/ansible/ansible.git
Fix ansible_failed_{task,result} undefined in rescue (#64831)
This is a fix for a regression introduced by Perfy. Since then we mainly operate on host.name instead of the Host object. In a call to set_nonpersistent_facts where we set ansible_failed_task and ansible_failed_result variables we were still passing the object which led to those vars being undefined. Fixes #64789pull/64785/merge
parent
f17a55a181
commit
5c0b2c151c
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- Fix regression when ``ansible_failed_task`` and ``ansible_failed_result`` are not defined in the rescue block (https://github.com/ansible/ansible/issues/64789)
|
||||
@ -0,0 +1,16 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- block:
|
||||
- name: EXPECTED FAILURE
|
||||
fail:
|
||||
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