ansible/test/integration/targets/blocks/block_rescue_vars.yml
Martin Krizek 5c0b2c151c
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 #64789
2019-11-14 15:50:54 +01:00

16 lines
412 B
YAML

- 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