From ad94a3a6a264b1ed9b9ccb8f1e61ebfe33c57a51 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 13 Dec 2017 11:46:23 -0500 Subject: [PATCH] fix reconcile to ensure 'ungrouped' also removed redundant 'hosts to all' as all groups already ensure that inheritance --- lib/ansible/inventory/data.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ansible/inventory/data.py b/lib/ansible/inventory/data.py index f11251966aa..04308a0ed91 100644 --- a/lib/ansible/inventory/data.py +++ b/lib/ansible/inventory/data.py @@ -125,10 +125,6 @@ class InventoryData(object): mygroups = host.get_groups() - # ensure hosts are always in 'all' - if 'all' not in mygroups and not host.implicit: - self.add_child('all', host.name) - if self.groups['ungrouped'] in mygroups: # clear ungrouped of any incorrectly stored by parser if set(mygroups).difference(set([self.groups['all'], self.groups['ungrouped']])): @@ -137,7 +133,7 @@ class InventoryData(object): elif not host.implicit: # add ungrouped hosts to ungrouped, except implicit length = len(mygroups) - if length == 0 or (length == 1 and all in mygroups): + if length == 0 or (length == 1 and self.groups['all'] in mygroups): self.add_child('ungrouped', host.name) # special case for implicit hosts