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
d9f91be3
Commit
d9f91be3
authored
Jun 16, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3227 from bcoca/modules_wantlist
implementing with_items list globbing made easier for modules
parents
f8729984
4942a06b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
lib/ansible/runner/__init__.py
+6
-2
library/packaging/apt
+1
-0
library/packaging/pkgng
+1
-0
library/packaging/yum
+1
-0
No files found.
lib/ansible/runner/__init__.py
View file @
d9f91be3
...
...
@@ -163,6 +163,7 @@ class Runner(object):
self
.
is_playbook
=
is_playbook
self
.
environment
=
environment
self
.
complex_args
=
complex_args
self
.
module_with_list
=
False
self
.
callbacks
.
runner
=
self
...
...
@@ -405,8 +406,8 @@ class Runner(object):
if
type
(
items
)
!=
list
:
raise
errors
.
AnsibleError
(
"lookup plugins have to return a list:
%
r"
%
items
)
if
len
(
items
)
and
utils
.
is_list_of_strings
(
items
)
and
self
.
module_
name
in
[
'apt'
,
'yum'
,
'pkgng'
]
:
#
hack for apt, yum, and pkgng so that with_items maps back into a single module call
if
len
(
items
)
and
utils
.
is_list_of_strings
(
items
)
and
self
.
module_
with_list
:
#
with_items maps back into a single module call, making modules that support this more efficient
inject
[
'item'
]
=
","
.
join
(
items
)
items
=
None
...
...
@@ -711,6 +712,9 @@ class Runner(object):
if
'WANT_JSON'
in
module_data
:
module_style
=
'non_native_want_json'
if
'WITH_ITEMS_USES_LIST'
in
module_data
:
self
.
module_with_list
=
True
complex_args_json
=
utils
.
jsonify
(
complex_args
)
# We force conversion of module_args to str because module_common calls shlex.split,
# a standard library function that incorrectly handles Unicode input before Python 2.7.3.
...
...
library/packaging/apt
View file @
d9f91be3
#
!/usr/bin/python
#
-*-
coding
:
utf
-
8
-*-
#
WITH_ITEMS_USES_LIST
#
(
c
)
2012
,
Flowroute
LLC
#
Written
by
Matthew
Williams
<
matthew
@
flowroute
.
com
>
...
...
library/packaging/pkgng
View file @
d9f91be3
#!/usr/bin/python
# -*- coding: utf-8 -*-
# WITH_ITEMS_USES_LIST
# (c) 2013, bleader
# Written by bleader <bleader@ratonland.org>
...
...
library/packaging/yum
View file @
d9f91be3
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# WITH_ITEMS_USES_LIST
# (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
...
...
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