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
be58808f
Commit
be58808f
authored
Mar 10, 2014
by
Serge van Ginderachter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory script parser: do not add all the groups to *all* group
parent
0ceefbbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/ansible/inventory/script.py
+7
-3
No files found.
lib/ansible/inventory/script.py
View file @
be58808f
...
...
@@ -46,6 +46,7 @@ class InventoryScript(object):
self
.
host_vars_from_top
=
None
self
.
groups
=
self
.
_parse
(
stderr
)
def
_parse
(
self
,
err
):
all_hosts
=
{}
...
...
@@ -60,7 +61,7 @@ class InventoryScript(object):
raise
errors
.
AnsibleError
(
"failed to parse executable inventory script results:
%
s"
%
self
.
raw
)
for
(
group_name
,
data
)
in
self
.
raw
.
items
():
# in Ansible 1.3 and later, a "_meta" subelement may contain
# a variable "hostvars" which contains a hash for each host
# if this "hostvars" exists at all then do not call --host for each
...
...
@@ -97,8 +98,6 @@ class InventoryScript(object):
all
.
set_variable
(
k
,
v
)
else
:
group
.
set_variable
(
k
,
v
)
if
group
.
name
!=
all
.
name
:
all
.
add_child_group
(
group
)
# Separate loop to ensure all groups are defined
for
(
group_name
,
data
)
in
self
.
raw
.
items
():
...
...
@@ -108,6 +107,11 @@ class InventoryScript(object):
for
child_name
in
data
[
'children'
]:
if
child_name
in
groups
:
groups
[
group_name
]
.
add_child_group
(
groups
[
child_name
])
for
group
in
groups
.
values
():
if
group
.
depth
==
0
and
group
.
name
!=
'all'
:
all
.
add_child_group
(
group
)
return
groups
def
get_host_variables
(
self
,
host
):
...
...
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