From aa0434535ec72e2d96382948004d4fdaa6fcdf8e Mon Sep 17 00:00:00 2001 From: Peter Sankauskas Date: Tue, 6 Nov 2012 16:16:52 -0800 Subject: [PATCH] Adding 2 more groups of instances - instance types and key pairs --- plugins/inventory/ec2.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/inventory/ec2.py b/plugins/inventory/ec2.py index 504a693197c..9e87b0a5a31 100755 --- a/plugins/inventory/ec2.py +++ b/plugins/inventory/ec2.py @@ -298,7 +298,13 @@ class Ec2Inventory(object): # Inventory: Group by availability zone self.push(self.inventory, instance.placement, dest) - + + # Inventory: Group by instance type + self.push(self.inventory, self.to_safe('type_' + instance.instance_type), dest) + + # Inventory: Group by key pair + self.push(self.inventory, self.to_safe('key_' + instance.key_name), dest) + # Inventory: Group by security group try: for group in instance.groups: