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
542eeeb5
Commit
542eeeb5
authored
May 06, 2013
by
Matt Coddington
Committed by
Michael DeHaan
May 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option to ignore $legacy variable style substitution
parent
67e67bca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
examples/ansible.cfg
+7
-0
lib/ansible/constants.py
+1
-0
lib/ansible/utils/template.py
+5
-0
No files found.
examples/ansible.cfg
View file @
542eeeb5
...
...
@@ -102,6 +102,13 @@ sudo_exe=sudo
#
# hash_behaviour=replace
# How to handle variable replacement - as of 1.2, Jinja2 variable syntax is
# preferred, but we still support the old $variable replacement too.
# If you change legacy_playbook_variables to no then Ansible will no longer
# try to do replacement on $variable style variables.
#
# legacy_playbook_variables=yes
# if you need to use jinja2 extensions, you can list them here
# use a coma to separate extensions, e.g. :
# jinja2_extensions=jinja2.ext.do,jinja2.ext.i18n
...
...
lib/ansible/constants.py
View file @
542eeeb5
...
...
@@ -94,6 +94,7 @@ DEFAULT_KEEP_REMOTE_FILES = get_config(p, DEFAULTS, 'keep_remote_files', 'ANSIBL
DEFAULT_SUDO_EXE
=
get_config
(
p
,
DEFAULTS
,
'sudo_exe'
,
'ANSIBLE_SUDO_EXE'
,
'sudo'
)
DEFAULT_SUDO_FLAGS
=
get_config
(
p
,
DEFAULTS
,
'sudo_flags'
,
'ANSIBLE_SUDO_FLAGS'
,
'-H'
)
DEFAULT_HASH_BEHAVIOUR
=
get_config
(
p
,
DEFAULTS
,
'hash_behaviour'
,
'ANSIBLE_HASH_BEHAVIOUR'
,
'replace'
)
DEFAULT_LEGACY_PLAYBOOK_VARIABLES
=
get_config
(
p
,
DEFAULTS
,
'legacy_playbook_variables'
,
'ANSIBLE_LEGACY_PLAYBOOK_VARIABLES'
,
'yes'
)
DEFAULT_JINJA2_EXTENSIONS
=
get_config
(
p
,
DEFAULTS
,
'jinja2_extensions'
,
'ANSIBLE_JINJA2_EXTENSIONS'
,
None
)
DEFAULT_EXECUTABLE
=
get_config
(
p
,
DEFAULTS
,
'executable'
,
'ANSIBLE_EXECUTABLE'
,
'/bin/sh'
)
...
...
lib/ansible/utils/template.py
View file @
542eeeb5
...
...
@@ -142,6 +142,11 @@ def _legacy_varFind(basedir, text, vars, lookup_fatal, depth, expand_lists):
original data in the caller.
'''
# short circuit this whole function if we have specified we don't want
# legacy var replacement
if
C
.
DEFAULT_LEGACY_PLAYBOOK_VARIABLES
==
'no'
:
return
None
start
=
text
.
find
(
"$"
)
if
start
==
-
1
:
return
None
...
...
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