mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
VMware: add cluster name in facts (#53056)
Fixes: #45280 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
5fa3d307e8
commit
70f6cdb814
2 changed files with 9 additions and 0 deletions
|
@ -309,6 +309,8 @@ def gather_vm_facts(content, vm):
|
|||
try:
|
||||
host = vm.summary.runtime.host
|
||||
facts['hw_esxi_host'] = host.summary.config.name
|
||||
facts['hw_cluster'] = host.parent.name if host.parent and isinstance(host.parent, vim.ClusterComputeResource) else None
|
||||
|
||||
except vim.fault.NoPermission:
|
||||
# User does not have read permission for the host system,
|
||||
# proceed without this value. This value does not contribute or hamper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue