ansible-rookeries/deployment/uwsgi.yaml

25 lines
943 B
YAML

---
- hosts: all
vars:
web_server_home: /srv/www
web_server_group: www-data
uwsgi_venv: "{{ web_server_home }}/uwsgi"
uwsgi_config: "{{ web_server_home }}/config/uwsgi"
rookeries_uwsgi_ini: rookeries-uwsgi.ini
tasks:
- name: PIP install UWSGI server into target virtualenv
pip: name=uwsgi virtualenv={{ uwsgi_venv }} version=2.0
- name: Setup webapp deployment configuration folder with the correct permissions
file: path={{ uwsgi_config }} state=directory
owner={{ ansible_env.SUDO_USER }} group={{ web_server_group }} mode=0774
- name: Upload rookeries UWSGI configuration to web server home
copy: src=../config/uwsgi/{{ rookeries_uwsgi_ini }} dest={{ uwsgi_config }}
# TODO Clean up configuration placement
# - name: Launches the UWSGI daemon
# command: "{{ uwsgi_venv }}/bin/uwsgi --ini {{ web_server_home }}/{{ rookeries_uwsgi_ini }}"