Skip to content

Commit

Permalink
Use hostname in group_by_aws_account to prevent duplicates. (ansible#…
Browse files Browse the repository at this point in the history
…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 ansible#23772

Signed-off-by: bo <[email protected]>
  • Loading branch information
robert-bo-davis authored and s-hertel committed Dec 19, 2017
1 parent bf8d695 commit b5c0141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/inventory/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def add_instance(self, instance, region):

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

Expand Down

0 comments on commit b5c0141

Please sign in to comment.