Skip to content

Commit

Permalink
better logic for all-group variables for implicit localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
srgvg committed Aug 19, 2014
1 parent 3c06833 commit 0ab721d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/ansible/inventory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def _create_implicit_localhost(self, pattern):
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

Expand Down Expand Up @@ -452,10 +453,6 @@ def _get_host_variables(self, hostname, vault_password=None):

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:
Expand Down

0 comments on commit 0ab721d

Please sign in to comment.