mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix for getting vars and hostvars without specifying the host
This commit is contained in:
parent
859b5df1d4
commit
eba01d5a8b
1 changed files with 2 additions and 3 deletions
|
@ -106,7 +106,7 @@ class HostVars(collections.Mapping):
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
for host in self._inventory.hosts:
|
for host in self._inventory.hosts:
|
||||||
yield host.name
|
yield host
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self._inventory.hosts)
|
return len(self._inventory.hosts)
|
||||||
|
@ -114,6 +114,5 @@ class HostVars(collections.Mapping):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
out = {}
|
out = {}
|
||||||
for host in self._inventory.hosts:
|
for host in self._inventory.hosts:
|
||||||
name = host.name
|
out[host] = self.get(host)
|
||||||
out[name] = self.get(name)
|
|
||||||
return repr(out)
|
return repr(out)
|
||||||
|
|
Loading…
Reference in a new issue