mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
add repr for hostvars (#15793)
* allows passing full hostvars to a module
This commit is contained in:
committed by
Brian Coca
parent
9e88fa21f5
commit
ddd9f92255
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user