|
|
@ -126,16 +126,16 @@ class InventoryModule(BaseFileInventoryPlugin):
|
|
|
|
if section in group_data and isinstance(group_data[section], string_types):
|
|
|
|
if section in group_data and isinstance(group_data[section], string_types):
|
|
|
|
group_data[section] = {group_data[section]: None}
|
|
|
|
group_data[section] = {group_data[section]: None}
|
|
|
|
|
|
|
|
|
|
|
|
if 'vars' in group_data:
|
|
|
|
if group_data.get('vars', False):
|
|
|
|
for var in group_data['vars']:
|
|
|
|
for var in group_data['vars']:
|
|
|
|
self.inventory.set_variable(group, var, group_data['vars'][var])
|
|
|
|
self.inventory.set_variable(group, var, group_data['vars'][var])
|
|
|
|
|
|
|
|
|
|
|
|
if 'children' in group_data:
|
|
|
|
if group_data.get('children', False):
|
|
|
|
for subgroup in group_data['children']:
|
|
|
|
for subgroup in group_data['children']:
|
|
|
|
self._parse_group(subgroup, group_data['children'][subgroup])
|
|
|
|
self._parse_group(subgroup, group_data['children'][subgroup])
|
|
|
|
self.inventory.add_child(group, subgroup)
|
|
|
|
self.inventory.add_child(group, subgroup)
|
|
|
|
|
|
|
|
|
|
|
|
if 'hosts' in group_data:
|
|
|
|
if group_data.get('hosts', False):
|
|
|
|
for host_pattern in group_data['hosts']:
|
|
|
|
for host_pattern in group_data['hosts']:
|
|
|
|
hosts, port = self._parse_host(host_pattern)
|
|
|
|
hosts, port = self._parse_host(host_pattern)
|
|
|
|
self.populate_host_vars(hosts, group_data['hosts'][host_pattern] or {}, group, port)
|
|
|
|
self.populate_host_vars(hosts, group_data['hosts'][host_pattern] or {}, group, port)
|
|
|
|