VMware: Add uptime and maintenance mode in vmware_host_facts (#60688)
* adding host facts * adding to test
This commit is contained in:
parent
aea52c67d6
commit
555b8413a1
2 changed files with 8 additions and 0 deletions
|
@ -110,6 +110,7 @@ ansible_facts:
|
||||||
"ansible_distribution_build": "4887370",
|
"ansible_distribution_build": "4887370",
|
||||||
"ansible_distribution_version": "6.5.0",
|
"ansible_distribution_version": "6.5.0",
|
||||||
"ansible_hostname": "10.76.33.100",
|
"ansible_hostname": "10.76.33.100",
|
||||||
|
"ansible_in_maintenance_mode": true,
|
||||||
"ansible_interfaces": [
|
"ansible_interfaces": [
|
||||||
"vmk0"
|
"vmk0"
|
||||||
],
|
],
|
||||||
|
@ -123,6 +124,7 @@ ansible_facts:
|
||||||
"ansible_product_name": "KVM",
|
"ansible_product_name": "KVM",
|
||||||
"ansible_product_serial": "NA",
|
"ansible_product_serial": "NA",
|
||||||
"ansible_system_vendor": "Red Hat",
|
"ansible_system_vendor": "Red Hat",
|
||||||
|
"ansible_uptime": 1791680,
|
||||||
"ansible_vmk0": {
|
"ansible_vmk0": {
|
||||||
"device": "vmk0",
|
"device": "vmk0",
|
||||||
"ipv4": {
|
"ipv4": {
|
||||||
|
@ -277,6 +279,8 @@ class VMwareHostFactManager(PyVmomi):
|
||||||
'ansible_product_serial': sn,
|
'ansible_product_serial': sn,
|
||||||
'ansible_bios_date': self.host.hardware.biosInfo.releaseDate,
|
'ansible_bios_date': self.host.hardware.biosInfo.releaseDate,
|
||||||
'ansible_bios_version': self.host.hardware.biosInfo.biosVersion,
|
'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
|
return facts
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
that:
|
that:
|
||||||
- "'ansible_hostname' in facts['ansible_facts']"
|
- "'ansible_hostname' in facts['ansible_facts']"
|
||||||
- "'ansible_processor' 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
|
- name: get host facts through from a host
|
||||||
vmware_host_facts:
|
vmware_host_facts:
|
||||||
|
@ -32,3 +34,5 @@
|
||||||
that:
|
that:
|
||||||
- "'ansible_hostname' in facts['ansible_facts']"
|
- "'ansible_hostname' in facts['ansible_facts']"
|
||||||
- "'ansible_processor' 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…
Reference in a new issue