Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
da5de725
Commit
da5de725
authored
Sep 18, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow with_first_files to search relative to templates and vars in roles
Fixes #8879
parent
f7b5b857
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
lib/ansible/runner/lookup_plugins/first_found.py
+11
-4
No files found.
lib/ansible/runner/lookup_plugins/first_found.py
View file @
da5de725
...
...
@@ -172,14 +172,21 @@ class LookupModule(object):
else
:
total_search
=
terms
result
=
None
for
fn
in
total_search
:
if
inject
and
'_original_file'
in
inject
:
# check the templates and vars directories too,
# if they exist
for
roledir
in
(
'templates'
,
'vars'
):
path
=
utils
.
path_dwim
(
os
.
path
.
join
(
self
.
basedir
,
'..'
,
roledir
),
fn
)
if
os
.
path
.
exists
(
path
):
return
[
path
]
# if none of the above were found, just check the
# current filename against the basedir (this will already
# have ../files from runner, if it's a role task
path
=
utils
.
path_dwim
(
self
.
basedir
,
fn
)
if
os
.
path
.
exists
(
path
):
return
[
path
]
if
not
result
:
else
:
if
skip
:
return
[]
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment