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.pull/4420/head
parent
20fc6a29d3
commit
9d5a79f586
|
@ -319,11 +319,7 @@ class Runner(object):
|
||||||
# 'hostvars' variable contains variables for each host name
|
# 'hostvars' variable contains variables for each host name
|
||||||
# ... and is set elsewhere
|
# ... and is set elsewhere
|
||||||
# 'inventory_hostname' is also set elsewhere
|
# 'inventory_hostname' is also set elsewhere
|
||||||
group_hosts = {}
|
inject['groups'] = self.inventory.groups_list()
|
||||||
for g in self.inventory.groups:
|
|
||||||
group_hosts[g.name] = [ h.name for h in g.hosts ]
|
|
||||||
inject['groups'] = group_hosts
|
|
||||||
|
|
||||||
# allow module args to work as a dictionary
|
# allow module args to work as a dictionary
|
||||||
# though it is usually a string
|
# though it is usually a string
|
||||||
new_args = ""
|
new_args = ""
|
||||||
|
|
Loading…
Reference in New Issue