Check to make sure the host is in the inventory vars cache before clearing it

Fixes #6660
pull/6638/merge
James Cammarata 11 years ago
parent db345391e3
commit dc658eaa1c

@ -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)

Loading…
Cancel
Save