Question:
I am trying to set up my remote servers and have Anisble install required packages. In my playbook.yml
everything works fine except when it tries to install requirments.txt
only on one remote server. It gives me the following error:
1 2 |
FAILED! => {"changed": false, "msg": "No setuptools found in remote host, please install it first."} |
And yes, I do have setuptools
install on the remote host.
1 2 3 4 5 6 7 8 9 10 11 12 |
# pip3 show setuptools Name: setuptools Version: 40.4.3 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://github.com/pypa/setuptools Author: Python Packaging Authority Author-email: distutils-sig@python.org License: UNKNOWN Location: /usr/lib/python3.6/site-packages Requires: Required-by: pipenv |
Not sure why it even needs setuptools when I’m using pip3 to install.
Here is my playbook snippet:
1 2 3 4 5 |
- name: Install requirements pip: requirements: /.supv/bridge_modules/requirements.txt executable: pip3 |
It seems to work fine on the other remote hosts, just this one is having trouble. I’ve tried to uninstall setuptools and reinstall, still no luck. Any ideas?
Answer:
Ansible needs setuptools to be installed for the version of Python that is being used to run Ansible modules, which, by default, is Python 2. So you need to run pip2 install setuptools
or equivalent in order to install setuptools in Python 2.