mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
VMware: Add ESXi hostname in fact details (#34981)
Fixes: #33972 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
80361ce4da
commit
082654894a
1 changed files with 5 additions and 0 deletions
|
@ -100,6 +100,10 @@ class VmwareVmFacts(PyVmomi):
|
|||
else:
|
||||
net_dict[device.macAddress]['ipv4'].append(ip_addr)
|
||||
|
||||
esxi_hostname = None
|
||||
if summary.runtime.host:
|
||||
esxi_hostname = summary.runtime.host.summary.config.name
|
||||
|
||||
virtual_machine = {
|
||||
summary.config.name: {
|
||||
"guest_fullname": summary.config.guestFullName,
|
||||
|
@ -108,6 +112,7 @@ class VmwareVmFacts(PyVmomi):
|
|||
"mac_address": _mac_address, # Kept for backward compatibility
|
||||
"uuid": summary.config.uuid,
|
||||
"vm_network": net_dict,
|
||||
"esxi_hostname": esxi_hostname,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue