I have recently updated to Ansible 2.4.2
I have plays that will remove old snapshots from specific VMs and will create new snapshots for those VMs.
The remove playbook is as follows:
`
I have recently updated to Ansible 2.4.2
I have plays that will remove old snapshots from specific VMs and will create new snapshots for those VMs.
The remove playbook is as follows:
`
I was able to use another module to solve this issue. I setup a play using the module vmware_guest_find.
The play I used is:
`
hosts: localhost
vars_prompt:
name: username
prompt: “VCenter username”
private: no
name: password
prompt: “VCenter password”
private: yes
tasks:
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 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.