mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
This commit is contained in:
parent
726c6eb889
commit
a7f45c0660
2 changed files with 14 additions and 4 deletions
|
@ -202,6 +202,10 @@ class TaskExecutor:
|
||||||
# get search path for this task to pass to lookup plugins
|
# get search path for this task to pass to lookup plugins
|
||||||
self._job_vars['ansible_search_path'] = self._task.get_search_path()
|
self._job_vars['ansible_search_path'] = self._task.get_search_path()
|
||||||
|
|
||||||
|
# ensure basedir is always in (dwim already searches here but we need to display it)
|
||||||
|
if self._loader.get_basedir() not in self._job_vars['ansible_search_path']:
|
||||||
|
self._job_vars['ansible_search_path'].append(self._loader.get_basedir())
|
||||||
|
|
||||||
templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=self._job_vars)
|
templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=self._job_vars)
|
||||||
items = None
|
items = None
|
||||||
if self._task.loop_with:
|
if self._task.loop_with:
|
||||||
|
@ -253,10 +257,6 @@ class TaskExecutor:
|
||||||
if item is not None and not isinstance(item, UnsafeProxy):
|
if item is not None and not isinstance(item, UnsafeProxy):
|
||||||
items[idx] = UnsafeProxy(item)
|
items[idx] = UnsafeProxy(item)
|
||||||
|
|
||||||
# ensure basedir is always in (dwim already searches here but we need to display it)
|
|
||||||
if self._loader.get_basedir() not in self._job_vars['ansible_search_path']:
|
|
||||||
self._job_vars['ansible_search_path'].append(self._loader.get_basedir())
|
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
|
||||||
def _run_loop(self, items):
|
def _run_loop(self, items):
|
||||||
|
|
|
@ -223,3 +223,13 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- with_list_passed_a_dict is failed
|
- with_list_passed_a_dict is failed
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
var: "item"
|
||||||
|
loop:
|
||||||
|
- "{{ ansible_search_path }}"
|
||||||
|
register: loop_search_path
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- ansible_search_path == loop_search_path.results.0.item
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue