diff --git a/lib/ansible/inventory/group.py b/lib/ansible/inventory/group.py index 599b53c0a0..80d72b17b5 100644 --- a/lib/ansible/inventory/group.py +++ b/lib/ansible/inventory/group.py @@ -50,11 +50,11 @@ class Group(object): def get_hosts(self): - hosts = [] + hosts = set() for kid in self.child_groups: - hosts.extend(kid.get_hosts()) - hosts.extend(self.hosts) - return hosts + hosts.update(kid.get_hosts()) + hosts.update(self.hosts) + return list(hosts) def get_variables(self):