Only attach hosts to a group if not already present in that group.
@@ -180,6 +180,7 @@ class Inventory(object):
# And push into any groups
for group_name in host_groups:
+ if host not in self.groups[group_name]:
self.groups[group_name].append(host)
return hosts
