Don't remove host vars when removing host from group
Don't remove host vars when removing host from group Change-Id: Id645cde1e0f7734cd09c1e406e52f05635cc4c82
This commit is contained in:
parent
7c0bc714f1
commit
23bec78cd5
|
@ -225,11 +225,10 @@ class Inventory(object):
|
|||
if not groupname or groupname == group.name:
|
||||
group.remove_host(host)
|
||||
|
||||
host_vars = os.path.join(get_host_vars_dir(), hostname)
|
||||
if os.path.exists(host_vars):
|
||||
os.remove(host_vars)
|
||||
|
||||
if not groupname:
|
||||
host_vars = os.path.join(get_host_vars_dir(), hostname)
|
||||
if os.path.exists(host_vars):
|
||||
os.remove(host_vars)
|
||||
del self._hosts[hostname]
|
||||
return changed
|
||||
|
||||
|
|
Loading…
Reference in New Issue