From 0ab721d51e77ba4779b86b200128ca08cdcd6b7b Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Tue, 19 Aug 2014 16:33:59 +0200 Subject: [PATCH] better logic for all-group variables for implicit localhost --- lib/ansible/inventory/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 4ea9c9dcc4..972042c9b1 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -324,6 +324,7 @@ class Inventory(object): if ungrouped is None: self.add_group(Group('ungrouped')) ungrouped = self.get_group('ungrouped') + self.get_group('all').add_child_group(ungrouped) ungrouped.add_host(new_host) return new_host @@ -452,10 +453,6 @@ class Inventory(object): vars = {} - # special case for ungrouped hosts, make sure group_vars/all is loaded - if len(host.groups) == 1 and host.groups[0].name == 'ungrouped': - vars = self.get_group_variables('all', vault_password=self._vault_password) - # plugin.run retrieves all vars (also from groups) for host vars_results = [ plugin.run(host, vault_password=vault_password) for plugin in self._vars_plugins if hasattr(plugin, 'run')] for updated in vars_results: