0

How to find the machine uptime in vmware from ansible.

I want to find the host uptime without connecting to the machine.

using ansible

ansible_vm_facts

I could able to get some details like

os, machine_name

but I did not get the uptime.

I followed the following documnets but no luck. nothing worked for me. http://docs.ansible.com/ansible/latest/modules/vmware_vm_facts_module.html http://docs.ansible.com/ansible/latest/modules/vmware_host_module.html

monu
  • 23
  • 1
  • 8

1 Answers1

-1

The primer from ansible documentation explains what info you can obtain with the debug module:

register: vmvariable

- debug:
      var: vmvariable

but I think that you cant get uptime value without getting facts from the host.

I think you can get this var from facts cache, but this fact will not be relevant.

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
f bsd
  • 1