Ensure hosts aren't duplicated in groups

This commit is contained in:
Matt Martz 2017-06-19 15:12:35 -05:00 committed by Brian Coca
commit b6ee9163e3
2 changed files with 3 additions and 2 deletions

View file

@ -112,7 +112,8 @@ class Group:
raise AnsibleError("The group named '%s' has a recursive dependency loop." % self.name)
def add_host(self, host):
if host in self.hosts:
return
self.hosts.append(host)
host.add_group(self)
self.clear_hosts_cache()