From b5c0141fb026b2b56322f94c2f9e69eb960d4895 Mon Sep 17 00:00:00 2001 From: "Robert \"Bo\" Davis" Date: Tue, 19 Dec 2017 17:04:46 -0500 Subject: [PATCH] Use hostname in group_by_aws_account to prevent duplicates. (#34053) Fix typo. The use of `dest` for group_by_aws_account causes the group to be produced using IP and to duplicate the hosts in the inventory. Fixes #23772 Signed-off-by: bo --- contrib/inventory/ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index e87c324a6ea..30636fc0234 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -1026,7 +1026,7 @@ class Ec2Inventory(object): # Inventory: Group by AWS account ID if self.group_by_aws_account: - self.push(self.inventory, self.aws_account_id, dest) + self.push(self.inventory, self.aws_account_id, hostname) if self.nested_groups: self.push_group(self.inventory, 'accounts', self.aws_account_id)