mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Ensure loop with delegate_to can short circuit the same as without delegate_to. Fixes #45189 (#45231)
This commit is contained in:
@@ -512,7 +512,12 @@ class VariableManager:
|
||||
else:
|
||||
raise AnsibleError("Failed to find the lookup named '%s' in the available lookup plugins" % task.loop_with)
|
||||
elif task.loop is not None:
|
||||
items = templar.template(task.loop)
|
||||
try:
|
||||
items = templar.template(task.loop)
|
||||
except AnsibleUndefinedVariable:
|
||||
# This task will be skipped later due to this, so we just setup
|
||||
# a dummy array for the later code so it doesn't fail
|
||||
items = [None]
|
||||
else:
|
||||
has_loop = False
|
||||
items = [None]
|
||||
|
||||
Reference in New Issue
Block a user