1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #8170 from sergevanginderachter/issue_8159

Load existing group_vars file for new group_by group
This commit is contained in:
James Cammarata 2014-07-16 14:28:14 -05:00
commit 62e9cf63b7

View file

@ -93,6 +93,7 @@ class ActionModule(object):
if not inv_group: if not inv_group:
inv_group = ansible.inventory.Group(name=group) inv_group = ansible.inventory.Group(name=group)
inventory.add_group(inv_group) inventory.add_group(inv_group)
inv_group.vars = inventory.get_group_variables(group, update_cached=False, vault_password=inventory._vault_password)
for host in hosts: for host in hosts:
if host in self.runner.inventory._vars_per_host: if host in self.runner.inventory._vars_per_host:
del self.runner.inventory._vars_per_host[host] del self.runner.inventory._vars_per_host[host]