diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/targets/blocks/runme.sh | 2 | ||||
-rw-r--r-- | test/integration/targets/blocks/unsafe_failed_task.yml | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/integration/targets/blocks/runme.sh b/test/integration/targets/blocks/runme.sh index 63bcd3fc3c..371937251e 100755 --- a/test/integration/targets/blocks/runme.sh +++ b/test/integration/targets/blocks/runme.sh @@ -103,3 +103,5 @@ rm -f role_complete_test.out # test notify inheritance ansible-playbook inherit_notify.yml "$@" + +ansible-playbook unsafe_failed_task.yml "$@" diff --git a/test/integration/targets/blocks/unsafe_failed_task.yml b/test/integration/targets/blocks/unsafe_failed_task.yml new file mode 100644 index 0000000000..adfa492ad9 --- /dev/null +++ b/test/integration/targets/blocks/unsafe_failed_task.yml @@ -0,0 +1,17 @@ +- hosts: localhost + gather_facts: false + vars: + - data: {} + tasks: + - block: + - name: template error + debug: + msg: "{{ data.value }}" + rescue: + - debug: + msg: "{{ ansible_failed_task.action }}" + + - assert: + that: + - ansible_failed_task.name == "template error" + - ansible_failed_task.action == "debug" |