I was able to use another module to solve this issue.  I setup a play using 
the module vmware_guest_find 
<http://docs.ansible.com/ansible/latest/vmware_guest_find_module.html>.

The play I used is:

- hosts: localhost
  vars_prompt:
    - name: username
      prompt: "VCenter username"
      private: no


    - name: password
      prompt: "VCenter password"
      private: yes


  tasks:
  - name: find vm paths
    vmware_guest_find:
      hostname: vcenter.host
      datacenter: QAE
      name: "{{ item }}"
      password: "{{ password }}"
      username: "{{ username }}"
      validate_certs: false
    register: path
    deligate_to: localhost
    with_items:
      - vm1.domain
      - vm2.domain
      - vm3.domain
      - vm4.domain
...



The output (with the verbosity increased -vv) is:
ok: [localhost] => (item=vm1.domain) => {"changed": false, "folders": 
["/vm/Staging"], "item": "vm1.domain"}


So this gave me the path of /vm/Staging.  Per the module documentation for 
vmware_guest_snapshot 
<http://docs.ansible.com/ansible/latest/vmware_guest_snapshot_module.html> it 
is stated that the datacenter should also be included in the folder.  So 
the value for folder, in my example, is "QAE/vm/Staging" and now my 
snapshot playbooks work.


I hope this is able to help someone else.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4d02eca5-2387-4427-a7af-7689e03b1eef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to