diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2021-04-15 21:48:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-15 21:48:57 +0200 |
commit | 664531d7d6253d5bdb182727501c08e3b5aea0c1 (patch) | |
tree | d5c0796726d9caef002f457aadc8509975ee9e03 /test/integration/targets/blocks | |
parent | Ini fixes (#74285) (diff) | |
download | ansible-664531d7d6253d5bdb182727501c08e3b5aea0c1.tar.xz ansible-664531d7d6253d5bdb182727501c08e3b5aea0c1.zip |
Prevent ansible_failed_task from further templating (#74290)
* Prevent ansible_failed_task from further templating
Fixes #74036
* Add changelog
Diffstat (limited to 'test/integration/targets/blocks')
-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" |