1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ec2 inventory script: Add a global group for EC2 and RDS instances when

listing EC2 inventory
This commit is contained in:
Herby Gillot 2013-09-02 22:02:56 -04:00
parent 6dd3505c9e
commit 36fe595de8

View file

@ -349,6 +349,9 @@ class Ec2Inventory(object):
key = self.to_safe("tag_" + k + "=" + v) key = self.to_safe("tag_" + k + "=" + v)
self.push(self.inventory, key, dest) self.push(self.inventory, key, dest)
# Global Tag: tag all EC2 instances
self.push(self.inventory, 'ec2', dest)
def add_rds_instance(self, instance, region): def add_rds_instance(self, instance, region):
''' Adds an RDS instance to the inventory and index, as long as it is ''' Adds an RDS instance to the inventory and index, as long as it is
@ -400,6 +403,9 @@ class Ec2Inventory(object):
# Inventory: Group by parameter group # Inventory: Group by parameter group
self.push(self.inventory, self.to_safe("rds_parameter_group_" + instance.parameter_group.name), dest) self.push(self.inventory, self.to_safe("rds_parameter_group_" + instance.parameter_group.name), dest)
# Global Tag: all RDS instances
self.push(self.inventory, 'rds', dest)
def get_host_info(self): def get_host_info(self):
''' Get variables about a specific host ''' ''' Get variables about a specific host '''