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
128c10b3
Commit
128c10b3
authored
Sep 25, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't template 'vars' dictionary during templating
Fixes #9132
parent
19703617
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/ansible/utils/template.py
+4
-2
No files found.
lib/ansible/utils/template.py
View file @
128c10b3
...
...
@@ -166,6 +166,7 @@ class _jinja2_vars(object):
return
False
def
__getitem__
(
self
,
varname
):
from
ansible.runner
import
HostVars
if
varname
not
in
self
.
vars
:
for
i
in
self
.
extras
:
if
varname
in
i
:
...
...
@@ -175,8 +176,9 @@ class _jinja2_vars(object):
else
:
raise
KeyError
(
"undefined variable:
%
s"
%
varname
)
var
=
self
.
vars
[
varname
]
# HostVars is special, return it as-is
if
isinstance
(
var
,
dict
)
and
type
(
var
)
!=
dict
:
# HostVars is special, return it as-is, as is the special variable
# 'vars', which contains the vars structure
if
isinstance
(
var
,
dict
)
and
varname
==
"vars"
or
isinstance
(
var
,
HostVars
):
return
var
else
:
return
template
(
self
.
basedir
,
var
,
self
.
vars
,
fail_on_undefined
=
self
.
fail_on_undefined
)
...
...
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