diff --git a/roles/wsgi_website/tasks/main.yml b/roles/wsgi_website/tasks/main.yml index 5f194c3103968976401cc9b22b36daa0f917b69a..e20812dc5310950d213c7d828aa117c0e9f638cb 100644 --- a/roles/wsgi_website/tasks/main.yml +++ b/roles/wsgi_website/tasks/main.yml @@ -122,6 +122,27 @@ # created (thanks to 'creates' parameter). - skip_ansible_lint +- name: Install latest pip in virtual environment + pip: + name: + - "pip>=18.0.0,<19.0.0" + virtualenv: "{{ home }}/virtualenv" + become: true + become_user: "{{ admin }}" + +# Workaround for: +# +# - https://github.com/pypa/pip/issues/4022 +# - https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463 +# - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871790 +- name: Remove the pkg-resources package from virtual environment (see comments above for details) + pip: + name: pkg-resources + virtualenv: "{{ home }}/virtualenv" + state: absent + become: true + become_user: "{{ admin }}" + - name: Configure project directory for the Python virtual environment template: src: "venv_project.j2"