title: How to use ipaddresses variable from vsphere_guest results in playbook?
body: <p>I want use the variable <code>ipaddresses</code> of <code>vsphere_guest</code>. I want to use the name of the virtual machine in vSphere first to get its IP address and then to run Ansible plays on that machine using the IP address.</p>
  
  <p>So far I have:</p>
  
  <pre><code>- hosts: localhost
    gather_facts: false
  
    vars_prompt:
      - name: "inventory_hostname"
        prompt: "Enter virtual machine name"
        private: no
        default: "ansible-test"
  
  
    vars:
      vcenter_hostname: '192.168.250.1'
      vcenter_user: 'root'
      vcenter_pass: 'pass'
  
    tasks:
      - vsphere_guest:
          vcenter_hostname: "{{ vcenter_hostname }}"
          username: "{{ vcenter_user }}"
          password: "{{ vcenter_pass }}"
          guest: "{{ inventory_hostname }}"
          vmware_guest_facts: yes
          validate_certs: no
        register: vsphere_facts
  </code></pre>
  
  <p>How should I proceed?</p>