mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 16:53:11 +00:00
Check to make sure the host is in the inventory vars cache before clearing it
Fixes #6660
This commit is contained in:
@@ -83,7 +83,8 @@ class ActionModule(object):
|
||||
inv_group = ansible.inventory.Group(name=group)
|
||||
inventory.add_group(inv_group)
|
||||
for host in hosts:
|
||||
del self.runner.inventory._vars_per_host[host]
|
||||
if host in self.runner.inventory._vars_per_host:
|
||||
del self.runner.inventory._vars_per_host[host]
|
||||
inv_host = inventory.get_host(host)
|
||||
if not inv_host:
|
||||
inv_host = ansible.inventory.Host(name=host)
|
||||
|
||||
Reference in New Issue
Block a user