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 <robert@jbanetwork.com>
This commit is contained in:
Robert "Bo" Davis 2017-12-19 17:04:46 -05:00 committed by Sloane Hertel
parent bf8d695ec3
commit b5c0141fb0

View file

@ -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)