mirror of https://github.com/ansible/ansible.git
test: error handling in include_role (#84737)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>pull/84774/head
parent
9bed0413ec
commit
532e3ea3ec
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
gather_facts: no
|
||||||
|
tasks:
|
||||||
|
- block:
|
||||||
|
- name: Setup
|
||||||
|
fail:
|
||||||
|
rescue:
|
||||||
|
- name: "Error handler"
|
||||||
|
include_role:
|
||||||
|
name: "error_handler"
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Check if we get correct failed_task details
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- ansible_failed_task.name == "Setup"
|
||||||
|
- ansible_failed_task.action == "fail"
|
||||||
|
vars:
|
||||||
|
ansible_connection: local
|
||||||
Loading…
Reference in New Issue