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
2f05e95d
Commit
2f05e95d
authored
Oct 25, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use lookup plugins for task include with_*
parent
026e251b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lib/ansible/playbook/play.py
+10
-4
No files found.
lib/ansible/playbook/play.py
View file @
2f05e95d
...
@@ -104,10 +104,16 @@ class Play(object):
...
@@ -104,10 +104,16 @@ class Play(object):
if
'include'
in
x
:
if
'include'
in
x
:
task_vars
=
self
.
vars
.
copy
()
task_vars
=
self
.
vars
.
copy
()
tokens
=
shlex
.
split
(
x
[
'include'
])
tokens
=
shlex
.
split
(
x
[
'include'
])
if
'with_items'
in
x
:
items
=
[
''
]
items
=
utils
.
varReplaceWithItems
(
self
.
basedir
,
x
[
'with_items'
],
task_vars
)
for
k
in
x
:
else
:
if
not
k
.
startswith
(
"with_"
):
items
=
[
''
]
continue
plugin_name
=
k
[
5
:]
if
plugin_name
not
in
self
.
playbook
.
lookup_plugins_list
:
raise
errors
.
AnsibleError
(
"cannot find lookup plugin named
%
s for usage in with_
%
s"
%
(
plugin_name
,
plugin_name
))
terms
=
utils
.
varReplaceWithItems
(
self
.
basedir
,
x
[
k
],
task_vars
)
items
=
self
.
playbook
.
lookup_plugins_list
[
plugin_name
]
.
LookupModule
(
None
)
.
run
(
terms
)
for
item
in
items
:
for
item
in
items
:
mv
=
task_vars
.
copy
()
mv
=
task_vars
.
copy
()
mv
[
'item'
]
=
item
mv
[
'item'
]
=
item
...
...
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