mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Add option to fail on undefined variables to listify
And use it in the call to get the loop items for a task.
This commit is contained in:
parent
a586c74967
commit
2673eb0afb
3 changed files with 14 additions and 7 deletions
|
@ -143,7 +143,7 @@ class TaskExecutor:
|
|||
|
||||
items = None
|
||||
if self._task.loop and self._task.loop in lookup_loader:
|
||||
loop_terms = listify_lookup_plugin_terms(terms=self._task.loop_args, variables=self._job_vars, loader=self._loader)
|
||||
loop_terms = listify_lookup_plugin_terms(terms=self._task.loop_args, variables=self._job_vars, loader=self._loader, fail_on_undefined=True)
|
||||
items = lookup_loader.get(self._task.loop, loader=self._loader).run(terms=loop_terms, variables=self._job_vars)
|
||||
|
||||
return items
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue