Setup supervisor to manage uwsgi + mailsink servers.

Use service command directly in controlling NGINX.
This commit is contained in:
Dorian 2014-11-20 08:09:15 -05:00
parent 9fa6c8cc44
commit 6f2cf82147
6 changed files with 24 additions and 4 deletions

View File

View File

@ -1,4 +1,5 @@
--- ---
- include: deployment/rookeries_install.yaml - include: deployment/rookeries_install.yaml
- include: deployment/email_server.yaml
- include: deployment/uwsgi.yaml - include: deployment/uwsgi.yaml
- include: deployment/email_server.yaml
- include: deployment/supervisor.yaml

View File

@ -1,6 +1,5 @@
--- ---
- hosts: all - hosts: all
sudo: yes
vars: vars:
web_server_home: /srv/www web_server_home: /srv/www
email_server_venv: "{{ web_server_home }}/mail_server" email_server_venv: "{{ web_server_home }}/mail_server"

View File

@ -0,0 +1,15 @@
---
- hosts: all
vars:
web_server_home: /srv/www
supervisor_venv: "{{ web_server_home }}/supervisord"
tasks:
- name: PIP install supervisor into target virtualenv
pip: name=supervisor virtualenv={{ supervisor }} version=4.0.0-dev extra_args=--pre
- name: Upload rookeries supervisor configuration to web server home
copy: src=../config/supervisor/supervisor.conf dest={{ web_server_home }}
# TODO Clean up configuration placement
# TODO Control supervisor with supervisorctl + ansible - http://docs.ansible.com/supervisorctl_module.html

View File

@ -6,11 +6,16 @@
rookeries_uwsgi_ini: rookeries-uwsgi.ini rookeries_uwsgi_ini: rookeries-uwsgi.ini
tasks: tasks:
- name: PIP install mailsink test server into target virtualenv - name: PIP install UWSGI server into target virtualenv
pip: name=uwsgi virtualenv={{ uwsgi_venv }} version=2.0 pip: name=uwsgi virtualenv={{ uwsgi_venv }} version=2.0
- name: PIP install supervisord into target virtualenv
pip: name=supervisor virtualenv={{ uwsgi_venv }} version=4.0.0-dev extra_args=--pre
- name: Upload rookeries UWSGI configuration to web server home - name: Upload rookeries UWSGI configuration to web server home
copy: src=../config/uwsgi/{{ rookeries_uwsgi_ini }} dest={{ web_server_home }} copy: src=../config/uwsgi/{{ rookeries_uwsgi_ini }} dest={{ web_server_home }}
# TODO Clean up configuration placement
# - name: Launches the UWSGI daemon # - name: Launches the UWSGI daemon
# command: "{{ uwsgi_venv }}/bin/uwsgi --ini {{ web_server_home }}/{{ rookeries_uwsgi_ini }}" # command: "{{ uwsgi_venv }}/bin/uwsgi --ini {{ web_server_home }}/{{ rookeries_uwsgi_ini }}"

View File

@ -22,7 +22,7 @@
file: state=absent path=/etc/nginx/sites-enabled/default file: state=absent path=/etc/nginx/sites-enabled/default
- name: Run nginx service - name: Run nginx service
command: service nginx restart service: name=nginx state=restarted
- name: Setup webapp deployment folder with the correct permissions - name: Setup webapp deployment folder with the correct permissions
file: path={{ web_server_home }} state=directory file: path={{ web_server_home }} state=directory