Ian Wienand b4c195b419 ensure-pip: use python2-pip when running under Python 2
When Ansible runs under Python 2, such as on SuSE 15, we need
python2-pip for pip: to work.  Update the default to install Python 2
deps when Ansible is running under v2.

Additionally for SuSE, as described inline we can have pip but not
setuptools.  Put in a work-around to always pull in the setuptools
package.  Pull this out into a separate file; history has shown that
we may need more :/

Change-Id: I450171aad5e31d2925239ab3d0641cd23f6815a2
2020-05-05 09:27:24 +10:00
..
2020-04-17 10:45:26 +02:00

Ensure pip is available

This role is intended install the requirements for the pip module on hosts.

Jobs that also wish to call pip via shell commands directly can also use this to ensure pip is available. However, it should be noted that calling pip is ambiguous when supporting many platforms. On some platforms it may install the package under the Python 2 interpreter and in others Python 3. You should use a qualified name (pip2 or pip3) to avoid confusion.

Role Variables

Output Variables

This variable will be set to a command appropriate for general usage with the pip module virtualenv_command argument on the host. On Python 3 hosts this will be the inbuilt venv module, on Python 2 hosts the virtualenv package will be installed (this is avoided on Python 3 hosts as an unnecessary dependency).