VMware: Add uptime and maintenance mode in vmware_host_facts (#60688)

* adding host facts
* adding to test
pull/60719/head
Ryan Butler 5 years ago committed by Abhijeet Kasurde
parent aea52c67d6
commit 555b8413a1

@ -110,6 +110,7 @@ ansible_facts:
"ansible_distribution_build": "4887370",
"ansible_distribution_version": "6.5.0",
"ansible_hostname": "10.76.33.100",
"ansible_in_maintenance_mode": true,
"ansible_interfaces": [
"vmk0"
],
@ -123,6 +124,7 @@ ansible_facts:
"ansible_product_name": "KVM",
"ansible_product_serial": "NA",
"ansible_system_vendor": "Red Hat",
"ansible_uptime": 1791680,
"ansible_vmk0": {
"device": "vmk0",
"ipv4": {
@ -277,6 +279,8 @@ class VMwareHostFactManager(PyVmomi):
'ansible_product_serial': sn,
'ansible_bios_date': self.host.hardware.biosInfo.releaseDate,
'ansible_bios_version': self.host.hardware.biosInfo.biosVersion,
'ansible_uptime': self.host.summary.quickStats.uptime,
'ansible_in_maintenance_mode': self.host.runtime.inMaintenanceMode,
}
return facts

@ -18,6 +18,8 @@
that:
- "'ansible_hostname' in facts['ansible_facts']"
- "'ansible_processor' in facts['ansible_facts']"
- "'ansible_in_maintenance_mode' in facts['ansible_facts']"
- "'ansible_uptime' in facts['ansible_facts']"
- name: get host facts through from a host
vmware_host_facts:
@ -32,3 +34,5 @@
that:
- "'ansible_hostname' in facts['ansible_facts']"
- "'ansible_processor' in facts['ansible_facts']"
- "'ansible_in_maintenance_mode' in facts['ansible_facts']"
- "'ansible_uptime' in facts['ansible_facts']"
Loading…
Cancel
Save