From 4e9a253bef7cd9c2fecf1112ac240f7616a6bb9f Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Wed, 16 Jul 2014 21:16:27 +0200 Subject: [PATCH] Load existing group_vars file for new group_by group if it was not loaded yet, which happens if that group didn't exist yet in the inventory. fixes #8159 --- lib/ansible/runner/action_plugins/group_by.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/runner/action_plugins/group_by.py b/lib/ansible/runner/action_plugins/group_by.py index 63e72711aa..d00ddc8d8c 100644 --- a/lib/ansible/runner/action_plugins/group_by.py +++ b/lib/ansible/runner/action_plugins/group_by.py @@ -93,6 +93,7 @@ class ActionModule(object): if not inv_group: inv_group = ansible.inventory.Group(name=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: if host in self.runner.inventory._vars_per_host: del self.runner.inventory._vars_per_host[host]