mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Made groups.groupname and group_names variables accessible in playbooks.
Also modified code that feeds the groups data structure to templates so that it resolves groups inside of groups to hostnames.
This commit is contained in:
@@ -319,11 +319,7 @@ class Runner(object):
|
||||
# 'hostvars' variable contains variables for each host name
|
||||
# ... and is set elsewhere
|
||||
# 'inventory_hostname' is also set elsewhere
|
||||
group_hosts = {}
|
||||
for g in self.inventory.groups:
|
||||
group_hosts[g.name] = [ h.name for h in g.hosts ]
|
||||
inject['groups'] = group_hosts
|
||||
|
||||
inject['groups'] = self.inventory.groups_list()
|
||||
# allow module args to work as a dictionary
|
||||
# though it is usually a string
|
||||
new_args = ""
|
||||
|
||||
Reference in New Issue
Block a user