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
ac66e400
Commit
ac66e400
authored
Aug 12, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for variable precedence with tasks/includes
Fixes #11881
parent
2688edb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lib/ansible/playbook/task.py
+3
-3
lib/ansible/plugins/strategies/__init__.py
+2
-2
No files found.
lib/ansible/playbook/task.py
View file @
ac66e400
...
...
@@ -212,19 +212,19 @@ class Task(Base, Conditional, Taggable, Become):
return
value
def
get_vars
(
self
):
all_vars
=
self
.
vars
.
copy
()
all_vars
=
dict
()
if
self
.
_block
:
all_vars
.
update
(
self
.
_block
.
get_vars
())
if
self
.
_task_include
:
all_vars
.
update
(
self
.
_task_include
.
get_vars
())
#if isinstance(self.args, dict):
# all_vars.update(self.args)
all_vars
.
update
(
self
.
vars
)
if
'tags'
in
all_vars
:
del
all_vars
[
'tags'
]
if
'when'
in
all_vars
:
del
all_vars
[
'when'
]
return
all_vars
def
copy
(
self
,
exclude_block
=
False
):
...
...
lib/ansible/plugins/strategies/__init__.py
View file @
ac66e400
...
...
@@ -406,9 +406,9 @@ class StrategyBase:
# set the vars for this task from those specified as params to the include
for
b
in
block_list
:
temp_vars
=
b
.
vars
.
copy
()
temp_vars
=
b
.
_task_include
.
vars
.
copy
()
temp_vars
.
update
(
included_file
.
_args
.
copy
())
b
.
vars
=
temp_vars
b
.
_task_include
.
vars
=
temp_vars
return
block_list
...
...
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