add repr for hostvars (#15793)
* allows passing full hostvars to a module
This commit is contained in:
parent
9e88fa21f5
commit
ddd9f92255
1 changed files with 6 additions and 0 deletions
|
@ -99,3 +99,9 @@ class HostVars(collections.Mapping):
|
|||
def __len__(self):
|
||||
return len(self._inventory.get_hosts(ignore_limits_and_restrictions=True))
|
||||
|
||||
def __repr__(self):
|
||||
out = {}
|
||||
for host in self._inventory.get_hosts(ignore_limits_and_restrictions=True):
|
||||
name = host.name
|
||||
out[name] = self.get(name)
|
||||
return repr(out)
|
||||
|
|
Loading…
Reference in a new issue