46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
---
|
|
- name: Install uWSGI
|
|
apt:
|
|
install_recommends: false
|
|
update_cache: true
|
|
name:
|
|
- uwsgi
|
|
- uwsgi-plugin-python3
|
|
register: apt_result
|
|
retries: 3
|
|
until: apt_result is succeeded
|
|
|
|
- name: Copy constellation uWSGI app
|
|
template:
|
|
src: "uwsgi/apps-available/constellation.ini.j2"
|
|
dest: "/etc/uwsgi/apps-available/constellation.ini"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: Reload uWSGI
|
|
|
|
- name: Activate constellation uWSGI app
|
|
file:
|
|
src: "../apps-available/constellation.ini"
|
|
dest: "/etc/uwsgi/apps-enabled/constellation.ini"
|
|
owner: root
|
|
group: root
|
|
state: link
|
|
ignore_errors: "{{ ansible_check_mode }}"
|
|
notify: Reload uWSGI
|
|
|
|
- name: Collect static files
|
|
django_manage:
|
|
command: collectstatic
|
|
project_path: "/var/local/constellation"
|
|
|
|
- name: Migrate database
|
|
django_manage:
|
|
command: migrate
|
|
project_path: "/var/local/constellation"
|
|
|
|
- name: Load initial data
|
|
django_manage:
|
|
command: loaddata initial
|
|
project_path: "/var/local/constellation"
|