From df3c9355d593fa8a856ba6384ca9d5fa9cece757 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Fri, 1 Sep 2023 21:44:02 +0800 Subject: [PATCH] Fix empty hardware version in collected guest info Signed-off-by: Qi Zhang --- common/vm_get_guest_info.yml | 1 + plugin/ansible_vsphere_gosv_log.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/vm_get_guest_info.yml b/common/vm_get_guest_info.yml index 02606be0e..cab86730f 100644 --- a/common/vm_get_guest_info.yml +++ b/common/vm_get_guest_info.yml @@ -16,6 +16,7 @@ - name: "Get guest info retrieved by VMware Tools" ansible.builtin.set_fact: + guestinfo_hardware_version: "{{ vm_guestinfo.instance.guest.hwVersion }}" guestinfo_guest_id: "{{ vm_guestinfo.instance.guest.guestId }}" guestinfo_guest_full_name: "{{ vm_guestinfo.instance.guest.guestFullName }}" guestinfo_guest_family: "{{ vm_guestinfo.instance.guest.guestFamily }}" diff --git a/plugin/ansible_vsphere_gosv_log.py b/plugin/ansible_vsphere_gosv_log.py index 5c3280f87..a78fa2735 100644 --- a/plugin/ansible_vsphere_gosv_log.py +++ b/plugin/ansible_vsphere_gosv_log.py @@ -226,7 +226,7 @@ def __init__(self, ansible_gosv_facts={}): ansible_gosv_facts['esxi_update_version'] != 'N/A'): self.ESXi_Version += ' U' + ansible_gosv_facts['esxi_update_version'] self.ESXi_Build = ansible_gosv_facts.get('esxi_build', '') - self.Hardware_Version = ansible_gosv_facts.get('vm_hardware_version','') + self.Hardware_Version = ansible_gosv_facts.get('guestinfo_hardware_version','') self.VMTools_Version = ansible_gosv_facts.get('guestinfo_vmtools_info', '') self.Config_Guest_Id = ansible_gosv_facts.get('vm_guest_id', '') self.GuestInfo_Guest_Id = ansible_gosv_facts.get('guestinfo_guest_id', '')