vSphere Playbook runs from Ansible Tower but not when run with Ansible-Playbook

I’ve written a playbook to interact with a VMWare vSphere instance I have which will start up a set of VMs however I’m running into an issue where I can’t run the playbook using ansible-playbook but I can run it from within Tower.

I have the community.vmware module installed on my node.

The error I’m getting relates to PyVmomi not being installed or unable to be found by ansible-playbook:

“Failed to import the required Python library (PyVmomi) on bmtower-3-01’s Python /usr/libexec/platform-python. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter”

Any help would be much appreciated!

Thanks

Yoy need to install the pyvomi through pip on your machine. Create a virtual environment if needed

Thanks a ton!

Installed PyVmomi and everything’s up and running again