Fixed bug when all group vars are not included

This commit is contained in:
Rick Stokkingreef
2018-11-06 14:26:36 +01:00
parent 3fef7acaa8
commit f916bd7994
2 changed files with 27 additions and 0 deletions

View File

@@ -297,6 +297,9 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
if not (data.get(group_name, {}).get('hosts', []) or data.get(group_name, {}).get('children', [])):
data.pop(group_name)
# Add the all group
data['all'] = all_group
if hostvars:
data.setdefault('_meta', dict())
data['_meta'].setdefault('hostvars', dict())