mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #6676 from danjenkins/add-vpc-inventory-group
Add a new inventory group so you can see instances in a particular VPC
This commit is contained in:
commit
0069809251
1 changed files with 7 additions and 3 deletions
|
@ -433,6 +433,10 @@ class Ec2Inventory(object):
|
||||||
if self.nested_groups:
|
if self.nested_groups:
|
||||||
self.push_group(self.inventory, 'keys', key_name)
|
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
|
# Inventory: Group by security group
|
||||||
try:
|
try:
|
||||||
for group in instance.groups:
|
for group in instance.groups:
|
||||||
|
|
Loading…
Reference in a new issue