mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -07:00
Ensure hosts aren't duplicated in groups
This commit is contained in:
parent
9730d96517
commit
b6ee9163e3
2 changed files with 3 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue