mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 18:04:02 -07:00
centralize path list handling
move it to constants and avoid duplicating code or misinforming developers on the nature of the data
This commit is contained in:
parent
3f6166d2bf
commit
92d154f4ef
4 changed files with 20 additions and 18 deletions
|
@ -123,7 +123,8 @@ class ActionModule(ActionBase):
|
|||
# loader, so that it knows about the other paths to find template files
|
||||
searchpath = [self._loader._basedir, os.path.dirname(source)]
|
||||
if self._task._role is not None:
|
||||
searchpath.insert(1, C.DEFAULT_ROLES_PATH)
|
||||
if C.DEFAULT_ROLES_PATH:
|
||||
searchpath[:0] = C.DEFAULT_ROLES_PATH
|
||||
searchpath.insert(1, self._task._role._role_path)
|
||||
|
||||
self._templar.environment.loader.searchpath = searchpath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue