This module gathers information on already created VMs:
- name: Gather facts on the yet_another_example_vm vm vmware_guest_facts: hostname: "{{ vsphere_host }}" username: "{{ vsphere_username }}" password: "{{ vsphere_password }}" validate_certs: "no" datacenter: "my-datacenter" folder: "/vms" name: "yet_another_example_vm" delegate_to: localhost register: facts
The previous example gathers lots of information on the machine we defined in the previous section and registers the information as a variable so that we can use it elsewhere in our playbook run.