From 3a1b84153ce047674f2bf5a0cdb0406f2780fff6 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 13 Jul 2017 13:10:22 -0400 Subject: [PATCH] ensure all groups inherit from 'all' --- lib/ansible/inventory/data.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/inventory/data.py b/lib/ansible/inventory/data.py index 43a044e4e8a..b928a587780 100644 --- a/lib/ansible/inventory/data.py +++ b/lib/ansible/inventory/data.py @@ -133,6 +133,10 @@ class InventoryData(object): group = self.groups[g] group_names.add(group.name) + # ensure all groups inherit from 'all' + if group.name != 'all' and not group.get_ancestors(): + self.add_child('all', group.name) + host_names = set() # get host vars from host_vars/ files and vars plugins for host in self.hosts.values():