|
@@ -106,49 +106,13 @@
|
|
|
group: "{{ user }}"
|
|
|
mode: 02750
|
|
|
|
|
|
# @TODO: Get rid of this if possible in Debian Buster.
|
|
|
# Do not install setuptools when creating the virtual environment -
|
|
|
# otherwise it will also install Debian-specific pkg-resources
|
|
|
# package. The pkg-resources package can be removed, but this breaks
|
|
|
# the package downloading via pip.
|
|
|
#
|
|
|
# Install setuptools later on via separate pip invocation.
|
|
|
#
|
|
|
# The pkg-resources package is also annoying because it shows-up in
|
|
|
# the output of the pip freeze command, and also interferes with the
|
|
|
# virtual environment management using pip-tools.
|
|
|
#
|
|
|
# For more details, see:
|
|
|
#
|
|
|
# - 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: Create Python virtual environment
|
|
|
command: '/usr/bin/virtualenv --no-setuptools --python "{{ python_interpreter }}" --prompt "({{ fqdn }})" "{{ home }}/virtualenv"'
|
|
|
command: '/usr/bin/virtualenv --python "{{ python_interpreter }}" --prompt "({{ fqdn }})" "{{ home }}/virtualenv"'
|
|
|
args:
|
|
|
creates: "{{ home }}/virtualenv/bin/{{ python_interpreter | basename }}"
|
|
|
become: true
|
|
|
become_user: "{{ admin }}"
|
|
|
|
|
|
# @TODO: Park of the pkg-resources described above.
|
|
|
- name: Install setuptools in virtual environment
|
|
|
pip:
|
|
|
name:
|
|
|
- "setuptools"
|
|
|
virtualenv: "{{ home }}/virtualenv"
|
|
|
become: true
|
|
|
become_user: "{{ admin }}"
|
|
|
|
|
|
# @TODO: Park of the pkg-resources described above.
|
|
|
- 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"
|