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
c2435fab
Commit
c2435fab
authored
Aug 03, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inject the play context vars into the variables used for loop item templating
parent
bcbcfc79
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lib/ansible/executor/task_executor.py
+10
-2
No files found.
lib/ansible/executor/task_executor.py
View file @
c2435fab
...
@@ -141,10 +141,18 @@ class TaskExecutor:
...
@@ -141,10 +141,18 @@ class TaskExecutor:
and returns the items result.
and returns the items result.
'''
'''
# create a copy of the job vars here so that we can modify
# them temporarily without changing them too early for other
# parts of the code that might still need a pristine version
vars_copy
=
self
.
_job_vars
.
copy
()
# now we update them with the play context vars
self
.
_play_context
.
update_vars
(
vars_copy
)
items
=
None
items
=
None
if
self
.
_task
.
loop
and
self
.
_task
.
loop
in
lookup_loader
:
if
self
.
_task
.
loop
and
self
.
_task
.
loop
in
lookup_loader
:
loop_terms
=
listify_lookup_plugin_terms
(
terms
=
self
.
_task
.
loop_args
,
variables
=
self
.
_job_vars
,
loader
=
self
.
_loader
,
fail_on_undefined
=
True
)
loop_terms
=
listify_lookup_plugin_terms
(
terms
=
self
.
_task
.
loop_args
,
variables
=
vars_copy
,
loader
=
self
.
_loader
,
fail_on_undefined
=
True
)
items
=
lookup_loader
.
get
(
self
.
_task
.
loop
,
loader
=
self
.
_loader
)
.
run
(
terms
=
loop_terms
,
variables
=
self
.
_job_vars
)
items
=
lookup_loader
.
get
(
self
.
_task
.
loop
,
loader
=
self
.
_loader
)
.
run
(
terms
=
loop_terms
,
variables
=
vars_copy
)
return
items
return
items
...
...
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