summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2021-04-04 21:13:39 -0500
committerGitHub <noreply@github.com>2021-04-04 21:13:39 -0500
commit1592c8b0fdca11af23256aa0aec7648c35f569cb (patch)
tree7b04b653ce5bf239122dfe9272d3467b2a82f2c0 /test/integration
parentf2d4f7344fd5d72af565450d814a888aec693c80 (diff)
downloadansible-1592c8b0fdca11af23256aa0aec7648c35f569cb.tar.gz
[stable-2.9] Ensure task from the worker is finalized/squashed (#73881) (#73929)
* Ensure task from the worker is finalized/squashed. Fixes #57399. Fixes #49942 (cherry picked from commit 832631b) Co-authored-by: Matt Martz <matt@sivel.net>
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/blocks/finalized_task.yml17
-rw-r--r--test/integration/targets/blocks/roles/fail/tasks/main.yml3
2 files changed, 20 insertions, 0 deletions
diff --git a/test/integration/targets/blocks/finalized_task.yml b/test/integration/targets/blocks/finalized_task.yml
new file mode 100644
index 0000000000..300401b51c
--- /dev/null
+++ b/test/integration/targets/blocks/finalized_task.yml
@@ -0,0 +1,17 @@
+- 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
diff --git a/test/integration/targets/blocks/roles/fail/tasks/main.yml b/test/integration/targets/blocks/roles/fail/tasks/main.yml
new file mode 100644
index 0000000000..176fe5423d
--- /dev/null
+++ b/test/integration/targets/blocks/roles/fail/tasks/main.yml
@@ -0,0 +1,3 @@
+- name: Fail
+ fail:
+ msg: fail