fix for yaml inventory in not likeing 'none'
This commit is contained in:
parent
82754c7a31
commit
43e0a0369b
1 changed files with 3 additions and 3 deletions
|
@ -83,19 +83,19 @@ class InventoryParser(object):
|
|||
if section in group_data and isinstance(group_data[section], string_types):
|
||||
group_data[section] = { group_data[section]: None}
|
||||
|
||||
if 'vars' in group_data:
|
||||
if group_data.get('vars', False):
|
||||
for var in group_data['vars']:
|
||||
if var != 'ansible_group_priority':
|
||||
self.groups[group].set_variable(var, group_data['vars'][var])
|
||||
else:
|
||||
self.groups[group].set_priority(group_data['vars'][var])
|
||||
|
||||
if 'children' in group_data:
|
||||
if group_data.get('children', False):
|
||||
for subgroup in group_data['children']:
|
||||
self._parse_groups(subgroup, group_data['children'][subgroup])
|
||||
self.groups[group].add_child_group(self.groups[subgroup])
|
||||
|
||||
if 'hosts' in group_data:
|
||||
if group_data.get('hosts', False):
|
||||
for host_pattern in group_data['hosts']:
|
||||
hosts = self._parse_host(host_pattern, group_data['hosts'][host_pattern])
|
||||
for h in hosts:
|
||||
|
|
Loading…
Reference in a new issue