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
2a8ab4ab
Commit
2a8ab4ab
authored
9 years ago
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9765 from runseb/update
Add tags for inventory
parents
8a76371a
19d40cc5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
plugins/inventory/apache-libcloud.py
+9
-4
No files found.
plugins/inventory/apache-libcloud.py
View file @
2a8ab4ab
...
@@ -222,12 +222,17 @@ class LibcloudInventory(object):
...
@@ -222,12 +222,17 @@ class LibcloudInventory(object):
self.push(self.inventory, self.to_safe('type_' + node.instance_type), dest)
self.push(self.inventory, self.to_safe('type_' + node.instance_type), dest)
'''
'''
# Inventory: Group by key pair
# Inventory: Group by key pair
if
node
.
extra
[
'keyname'
]:
if
node
.
extra
[
'key
_
name'
]:
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'key_'
+
node
.
extra
[
'keyname'
]),
dest
)
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'key_'
+
node
.
extra
[
'key
_
name'
]),
dest
)
# Inventory: Group by security group, quick thing to handle single sg
# Inventory: Group by security group, quick thing to handle single sg
if
node
.
extra
[
'securitygroup'
]:
if
node
.
extra
[
'security_group'
]:
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'sg_'
+
node
.
extra
[
'securitygroup'
][
0
]),
dest
)
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'sg_'
+
node
.
extra
[
'security_group'
][
0
]),
dest
)
# Inventory: Group by tag
if
node
.
extra
[
'tags'
]:
for
tagkey
in
node
.
extra
[
'tags'
]
.
keys
():
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'tag_'
+
tagkey
+
'_'
+
node
.
extra
[
'tags'
][
tagkey
]),
dest
)
def
get_host_info
(
self
):
def
get_host_info
(
self
):
'''
'''
...
...
This diff is collapsed.
Click to expand it.
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