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
f6e7381a
Commit
f6e7381a
authored
Nov 28, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Evaluate only_if in group_by
parent
93fe43f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
lib/ansible/runner/action_plugins/group_by.py
+3
-1
No files found.
lib/ansible/runner/action_plugins/group_by.py
View file @
f6e7381a
...
@@ -20,7 +20,7 @@ import ansible
...
@@ -20,7 +20,7 @@ import ansible
from
ansible.callbacks
import
vv
from
ansible.callbacks
import
vv
from
ansible.errors
import
AnsibleError
as
ae
from
ansible.errors
import
AnsibleError
as
ae
from
ansible.runner.return_data
import
ReturnData
from
ansible.runner.return_data
import
ReturnData
from
ansible.utils
import
parse_kv
,
template
from
ansible.utils
import
parse_kv
,
template
,
check_conditional
class
ActionModule
(
object
):
class
ActionModule
(
object
):
''' Create inventory groups based on variables '''
''' Create inventory groups based on variables '''
...
@@ -46,6 +46,8 @@ class ActionModule(object):
...
@@ -46,6 +46,8 @@ class ActionModule(object):
groups
=
{}
groups
=
{}
for
host
in
self
.
runner
.
host_set
:
for
host
in
self
.
runner
.
host_set
:
data
=
inject
[
'hostvars'
][
host
]
data
=
inject
[
'hostvars'
][
host
]
if
not
check_conditional
(
template
(
self
.
runner
.
basedir
,
self
.
runner
.
conditional
,
data
)):
continue
group_name
=
template
(
self
.
runner
.
basedir
,
args
[
'key'
],
data
)
group_name
=
template
(
self
.
runner
.
basedir
,
args
[
'key'
],
data
)
group_name
=
group_name
.
replace
(
' '
,
'-'
)
group_name
=
group_name
.
replace
(
' '
,
'-'
)
if
group_name
not
in
groups
:
if
group_name
not
in
groups
:
...
...
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