mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
adds 'groups' variable, essentially making hosts file accessible as a variable
This commit is contained in:
parent
3d7a51f2ec
commit
cedbcfcc0a
1 changed files with 6 additions and 0 deletions
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in a new issue