|
@@ -114,8 +114,10 @@
|
|
|
group: "{{ user }}"
|
|
|
mode: 02750
|
|
|
|
|
|
# setuptools is excluded on Stretch, because it would pull-in the
|
|
|
# pkg-resources package that then messes with pip freeze etc.
|
|
|
- name: Create Python virtual environment
|
|
|
command: '/usr/bin/virtualenv --python "{{ python_interpreter }}" --prompt "({{ fqdn }})" "{{ home }}/virtualenv"'
|
|
|
command: '/usr/bin/virtualenv {{ no_setuptools }} --python "{{ python_interpreter }}" --prompt "({{ fqdn }})" "{{ home }}/virtualenv"'
|
|
|
args:
|
|
|
creates: "{{ home }}/virtualenv/bin/{{ python_interpreter | basename }}"
|
|
|
become: true
|
|
@@ -126,10 +128,11 @@
|
|
|
# created (thanks to 'creates' parameter).
|
|
|
- skip_ansible_lint
|
|
|
|
|
|
- name: Install latest pip in virtual environment
|
|
|
- name: Install latest pip and setuptools in virtual environment
|
|
|
pip:
|
|
|
name:
|
|
|
- "pip>=18.0.0,<19.0.0"
|
|
|
- "setuptools>=40.0.0,<41.0.0"
|
|
|
virtualenv: "{{ home }}/virtualenv"
|
|
|
become: true
|
|
|
become_user: "{{ admin }}"
|
|
@@ -174,6 +177,20 @@
|
|
|
with_items:
|
|
|
- package: gunicorn
|
|
|
version: "{{ gunicorn_version }}"
|
|
|
when: "not wsgi_requirements"
|
|
|
register: install_wsgi_server
|
|
|
notify:
|
|
|
- Restart WSGI services
|
|
|
|
|
|
- name: Install futures Python 2 backport (for WSGI server)
|
|
|
become: true
|
|
|
become_user: "{{ admin }}"
|
|
|
pip:
|
|
|
name: "{{ item.package }}"
|
|
|
version: "{{ item.version }}"
|
|
|
state: present
|
|
|
virtualenv: "{{ home }}/virtualenv"
|
|
|
with_items:
|
|
|
- package: futures
|
|
|
version: "{{ futures_version }}"
|
|
|
when: "not wsgi_requirements"
|