Permalink
Fetching contributors…
Cannot retrieve contributors at this time. Cannot retrieve contributors at this time
28 lines (23 sloc) 804 Bytes
---
# Make sure the virtualenv is created and requirements are installed
- name: Create virtualenv directory with correct file permissions
file: name="{{ venv }}"
state=directory
owner={{ application_user }}
group={{ application_user }}
mode=0754
remote_user: root
- name: Upgrade pip
pip: virtualenv={{ venv }}
name=pip
extra_args='--upgrade'
virtualenv_python=python3
- name: Install requirements
pip: virtualenv={{ venv }}
chdir={{ project_home }}
requirements=requirements/{{ target }}.txt
virtualenv_python=python3
notify:
- restart uwsgi
- name: Automatically export environment from file on the server itself
lineinfile: dest={{ venv }}/bin/activate state=present line="source {{ env_file_dest_bash }}"