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
d7b36dd9
Commit
d7b36dd9
authored
Mar 25, 2014
by
Dan Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new inventory group so you can see instances in a particular VPC
parent
ade083a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
plugins/inventory/ec2.py
+7
-3
No files found.
plugins/inventory/ec2.py
View file @
d7b36dd9
...
...
@@ -432,7 +432,11 @@ class Ec2Inventory(object):
self
.
push
(
self
.
inventory
,
key_name
,
dest
)
if
self
.
nested_groups
:
self
.
push_group
(
self
.
inventory
,
'keys'
,
key_name
)
# Inventory: Group by VPC
if
instance
.
vpc_id
:
self
.
push
(
self
.
inventory
,
self
.
to_safe
(
'vpc_id_'
+
instance
.
vpc_id
),
dest
)
# Inventory: Group by security group
try
:
for
group
in
instance
.
groups
:
...
...
@@ -504,13 +508,13 @@ class Ec2Inventory(object):
self
.
push
(
self
.
inventory
,
instance
.
availability_zone
,
dest
)
if
self
.
nested_groups
:
self
.
push_group
(
self
.
inventory
,
region
,
instance
.
availability_zone
)
# Inventory: Group by instance type
type_name
=
self
.
to_safe
(
'type_'
+
instance
.
instance_class
)
self
.
push
(
self
.
inventory
,
type_name
,
dest
)
if
self
.
nested_groups
:
self
.
push_group
(
self
.
inventory
,
'types'
,
type_name
)
# Inventory: Group by security group
try
:
if
instance
.
security_group
:
...
...
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