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
bb1d72f2
Commit
bb1d72f2
authored
Apr 25, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #235 from skvidal/devel
fix for issue #230 - handle template taking 3 args
parents
283b897a
fa2aebc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/ansible/playbook.py
+2
-2
lib/ansible/utils.py
+2
-2
No files found.
lib/ansible/playbook.py
View file @
bb1d72f2
...
...
@@ -154,7 +154,7 @@ class PlayBook(object):
include_vars
[
k
]
=
v
inject_vars
=
play_vars
.
copy
()
inject_vars
.
update
(
include_vars
)
included
=
utils
.
template_from_file
(
path
,
inject_vars
)
included
=
utils
.
template_from_file
(
path
,
inject_vars
,
SETUP_CACHE
)
included
=
utils
.
parse_yaml
(
included
)
for
x
in
included
:
if
len
(
include_vars
):
...
...
@@ -168,7 +168,7 @@ class PlayBook(object):
path
=
utils
.
path_dwim
(
dirname
,
handler
[
'include'
])
inject_vars
=
self
.
_get_vars
(
play
,
dirname
)
included
=
utils
.
template_from_file
(
path
,
inject_vars
)
included
=
utils
.
template_from_file
(
path
,
inject_vars
,
SETUP_CACHE
)
included
=
utils
.
parse_yaml
(
included
)
for
x
in
included
:
new_handlers
.
append
(
x
)
...
...
lib/ansible/utils.py
View file @
bb1d72f2
...
...
@@ -249,10 +249,10 @@ def template(text, vars, setup_cache):
def
double_template
(
text
,
vars
,
setup_cache
):
return
template
(
template
(
text
,
vars
,
setup_cache
),
vars
,
setup_cache
)
def
template_from_file
(
path
,
vars
):
def
template_from_file
(
path
,
vars
,
setup_cache
):
''' run a file through the templating engine '''
data
=
file
(
path
)
.
read
()
return
template
(
data
,
vars
)
return
template
(
data
,
vars
,
setup_cache
)
def
parse_yaml
(
data
):
return
yaml
.
load
(
data
)
...
...
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