1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Support for all:vars in script inventories

This commit is contained in:
Darryl Stoflet 2013-06-02 14:54:29 -07:00
parent 3b77d17a26
commit c0baf10845

View file

@ -76,8 +76,12 @@ class InventoryScript(object):
if 'vars' in data:
for k, v in data['vars'].iteritems():
group.set_variable(k, v)
all.add_child_group(group)
if group.name == all.name:
all.set_variable(k, v)
else:
group.set_variable(k, v)
if group.name != all.name:
all.add_child_group(group)
# Separate loop to ensure all groups are defined
for (group_name, data) in self.raw.items():