mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 13:44:24 -07:00
Fix first_found not finding files in roles (only templates)
This commit is contained in:
parent
ccbcfcddfc
commit
db5d3f03a9
1 changed files with 2 additions and 3 deletions
|
@ -185,14 +185,13 @@ class LookupModule(LookupBase):
|
||||||
else:
|
else:
|
||||||
if roledir is not None:
|
if roledir is not None:
|
||||||
# check the templates and vars directories too,if they exist
|
# check the templates and vars directories too,if they exist
|
||||||
for subdir in ('templates', 'vars'):
|
for subdir in ('templates', 'vars', 'files'):
|
||||||
path = self._loader.path_dwim_relative(roledir, subdir, fn)
|
path = self._loader.path_dwim_relative(roledir, subdir, fn)
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
return [path]
|
return [path]
|
||||||
|
|
||||||
# if none of the above were found, just check the
|
# if none of the above were found, just check the
|
||||||
# current filename against the basedir (this will already
|
# current filename against the current dir
|
||||||
# have ../files from runner, if it's a role task
|
|
||||||
path = self._loader.path_dwim(fn)
|
path = self._loader.path_dwim(fn)
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
return [path]
|
return [path]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue