mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Fix hostvars lookup of locahost based on 5f1bbb4
This commit is contained in:
parent
5f1bbb4fcd
commit
b51d0dd69b
1 changed files with 5 additions and 1 deletions
|
@ -62,7 +62,11 @@ class HostVars(collections.Mapping):
|
||||||
self._inventory = inventory
|
self._inventory = inventory
|
||||||
|
|
||||||
def _find_host(self, host_name):
|
def _find_host(self, host_name):
|
||||||
return self._inventory.get_host(host_name)
|
if host_name in C.LOCALHOST:
|
||||||
|
host = self._inventory.localhost
|
||||||
|
else:
|
||||||
|
host = self._inventory.get_host(host_name)
|
||||||
|
return host
|
||||||
|
|
||||||
def __getitem__(self, host_name):
|
def __getitem__(self, host_name):
|
||||||
host = self._find_host(host_name)
|
host = self._find_host(host_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue