---
- hosts: my-host
tasks:
- vsphere_guest:
vcenter_hostname: vcenter.mydomain.local
username: myuser
password: mypass
guest: newvm001
vmware_guest_facts: yes
When I run this playbook, I get this error
PLAY [my-host]
TASK [setup] ******************************************************************* ok: [19.3.112.97 ]
TASK [vsphere_guest] *********************************************************** fatal: [19.3.112.97 ]: FAILED! => {"changed": false, "failed": true, "msg": "pysphere module required"}
NO MORE HOSTS LEFT ************************************************************* [WARNING]: Could not create retry file 'createvms.retry'.
[Errno 2] No such file or directory: ''PLAY RECAP
19.3.112.97 : ok=1 changed=0 unreachable=0 failed=1
Why do I get this error? I have uninstalled and installed pysphere. I have used previous and current versions of it but I still get this error.
You usually want to run cloud/VM management modules from your control machine (localhost). This would look like this:
In this case ansible use PySphere installed on your control host to connect to
vcenter.mydomain.local
and provision VMs.In your example PySphere should be installed on
19.3.112.97
andvcenter.mydomain.local
should be accessible from that host.