
This role is intended to ensure that the `pip:` module, and jobs that may wish to use `pip` from the shell, have the necessary requirements. It is intended as a partial replacement for the pip-and-virtualenv element in diskimage-builder, which currently pre-installs pip on our infra CI images during image build. We wish to remain broady compatible with this element, but not replicate some of the more problematic areas of its implementation. By default, this installs the system packages for pip and setuptools (the latter being a requirement of the Ansible pip module, which imports it directly, despite pip itself not requiring it). In this role, we ensure the libraries for the currently running ansible_python_interpreter version are installed. There is provision to provide a flag to install the packages directly from upstream via get-pip.py, although this is not recommended. Story: #2007386 Task: #39309 Change-Id: Iac2d518a66caf1b801273225f75a0a748412903c
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