diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 075a9fba83..b5c05d5e45 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -290,6 +290,12 @@ class Runner(object): inject.update(host_variables) inject.update(self.module_vars) + group_hosts = {} + for g in self.inventory.groups: + group_hosts[g.name] = map((lambda x: x.get_variables()),g.hosts) + + inject['groups'] = group_hosts + if self.module_name == 'setup': if not args: args = {}