summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2018-09-07 10:16:03 -0500
committerToshio Kuratomi <a.badger@gmail.com>2018-09-07 13:01:55 -0700
commit3e14a34744a271522e101024cdc285f2967acd08 (patch)
tree58e4ab600d52457d523633a4893b6d24f473eef6 /test
parent1301d4edc8a4fbfbb0b988eb62cd3f4583648029 (diff)
downloadansible-3e14a34744a271522e101024cdc285f2967acd08.tar.gz
[stable-2.7] Ensure loop with delegate_to can short circuit the same as without delegate_to. Fixes #45189 (#45231)
(cherry picked from commit 2ac647d) Co-authored-by: Matt Martz <matt@sivel.net>
Diffstat (limited to 'test')
-rw-r--r--test/integration/targets/loops/tasks/main.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/integration/targets/loops/tasks/main.yml b/test/integration/targets/loops/tasks/main.yml
index 8b1d635e6e..1b8a745050 100644
--- a/test/integration/targets/loops/tasks/main.yml
+++ b/test/integration/targets/loops/tasks/main.yml
@@ -233,3 +233,22 @@
- assert:
that:
- ansible_search_path == loop_search_path.results.0.item
+
+# https://github.com/ansible/ansible/issues/45189
+- name: with_X conditional delegate_to shortcircuit on templating error
+ debug:
+ msg: "loop"
+ when: false
+ delegate_to: localhost
+ with_list: "{{ fake_var }}"
+ register: result
+ failed_when: result is not skipped
+
+- name: loop conditional delegate_to shortcircuit on templating error
+ debug:
+ msg: "loop"
+ when: false
+ delegate_to: localhost
+ loop: "{{ fake_var }}"
+ register: result
+ failed_when: result is not skipped