mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
433 B
YAML
18 lines
433 B
YAML
4 years ago
|
- hosts: localhost
|
||
|
gather_facts: false
|
||
|
tasks:
|
||
|
- block:
|
||
|
- include_role:
|
||
|
name: '{{ item }}'
|
||
|
loop:
|
||
|
- fail
|
||
|
rescue:
|
||
|
- debug:
|
||
|
msg: "{{ ansible_failed_task.name }}"
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- ansible_failed_task.name == "Fail"
|
||
|
- ansible_failed_task.action == "fail"
|
||
|
- ansible_failed_task.parent is not defined
|