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
b8a66ce5
Commit
b8a66ce5
authored
Jun 01, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lookup plugins in included files now look in paths relative to their files, allowing role usage.
parent
7f0e89a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
lib/ansible/runner/lookup_plugins/file.py
+1
-0
lib/ansible/utils/template.py
+7
-0
No files found.
lib/ansible/runner/lookup_plugins/file.py
View file @
b8a66ce5
...
@@ -25,6 +25,7 @@ class LookupModule(object):
...
@@ -25,6 +25,7 @@ class LookupModule(object):
self
.
basedir
=
basedir
self
.
basedir
=
basedir
def
run
(
self
,
terms
,
inject
=
None
,
**
kwargs
):
def
run
(
self
,
terms
,
inject
=
None
,
**
kwargs
):
terms
=
utils
.
listify_lookup_plugin_terms
(
terms
,
self
.
basedir
,
inject
)
terms
=
utils
.
listify_lookup_plugin_terms
(
terms
,
self
.
basedir
,
inject
)
ret
=
[]
ret
=
[]
...
...
lib/ansible/utils/template.py
View file @
b8a66ce5
...
@@ -81,6 +81,7 @@ def lookup(name, *args, **kwargs):
...
@@ -81,6 +81,7 @@ def lookup(name, *args, **kwargs):
from
ansible
import
utils
from
ansible
import
utils
instance
=
utils
.
plugins
.
lookup_loader
.
get
(
name
.
lower
(),
basedir
=
kwargs
.
get
(
'basedir'
,
None
))
instance
=
utils
.
plugins
.
lookup_loader
.
get
(
name
.
lower
(),
basedir
=
kwargs
.
get
(
'basedir'
,
None
))
vars
=
kwargs
.
get
(
'vars'
,
None
)
vars
=
kwargs
.
get
(
'vars'
,
None
)
if
instance
is
not
None
:
if
instance
is
not
None
:
ran
=
instance
.
run
(
*
args
,
inject
=
vars
,
**
kwargs
)
ran
=
instance
.
run
(
*
args
,
inject
=
vars
,
**
kwargs
)
return
","
.
join
(
ran
)
return
","
.
join
(
ran
)
...
@@ -470,6 +471,12 @@ def template_from_string(basedir, data, vars):
...
@@ -470,6 +471,12 @@ def template_from_string(basedir, data, vars):
environment
.
filters
.
update
(
_get_filters
())
environment
.
filters
.
update
(
_get_filters
())
environment
.
template_class
=
J2Template
environment
.
template_class
=
J2Template
if
'_original_file'
in
vars
:
basedir
=
os
.
path
.
dirname
(
vars
[
'_original_file'
])
filesdir
=
os
.
path
.
join
(
basedir
,
'..'
,
'files'
)
if
os
.
path
.
exists
(
filesdir
):
basedir
=
filesdir
# TODO: may need some way of using lookup plugins here seeing we aren't calling
# TODO: may need some way of using lookup plugins here seeing we aren't calling
# the legacy engine, lookup() as a function, perhaps?
# the legacy engine, lookup() as a function, perhaps?
...
...
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