Add configuration folder setup for uwsgi and supervisor.

Add convenience task for vagrant ssh.
This commit is contained in:
Dorian 2014-11-20 18:05:34 -05:00
parent 6f2cf82147
commit 79d7201e67
4 changed files with 30 additions and 18 deletions

View File

@ -0,0 +1,20 @@
---
- hosts: all
vars:
web_server_home: /srv/www
web_server_group: www-data
supervisor_config: "{{ web_server_home }}/config/supervisor"
supervisor_venv: "{{ web_server_home }}/supervisor"
tasks:
- name: PIP install supervisor into target virtualenv
pip: name=supervisor virtualenv={{ supervisor_venv }} version=3.1.3 extra_args=--pre
- name: Setup webapp deployment configuration folder with the correct permissions
file: path={{ supervisor_config }} state=directory
owner={{ ansible_env.SUDO_USER }} group={{ web_server_group }} mode=0774
- name: Upload rookeries supervisor configuration to web server home
copy: src=../config/supervisor/supervisor.conf dest={{ supervisor_config }}
# TODO Control supervisor with supervisorctl + ansible - http://docs.ansible.com/supervisorctl_module.html

View File

@ -1,15 +0,0 @@
---
- 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

@ -2,18 +2,21 @@
- hosts: all - hosts: all
vars: vars:
web_server_home: /srv/www web_server_home: /srv/www
web_server_group: www-data
uwsgi_venv: "{{ web_server_home }}/uwsgi" uwsgi_venv: "{{ web_server_home }}/uwsgi"
uwsgi_config: "{{ web_server_home }}/config/uwsgi"
rookeries_uwsgi_ini: rookeries-uwsgi.ini rookeries_uwsgi_ini: rookeries-uwsgi.ini
tasks: tasks:
- name: PIP install UWSGI 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 - name: Setup webapp deployment configuration folder with the correct permissions
pip: name=supervisor virtualenv={{ uwsgi_venv }} version=4.0.0-dev extra_args=--pre 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 - 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={{ uwsgi_config }}
# TODO Clean up configuration placement # TODO Clean up configuration placement

View File

@ -28,5 +28,9 @@
file: path={{ web_server_home }} state=directory file: path={{ web_server_home }} state=directory
owner={{ ansible_env.SUDO_USER }} group={{ web_server_group }} mode=0774 owner={{ ansible_env.SUDO_USER }} group={{ web_server_group }} mode=0774
- name: Setup webapp deployment configuration folder with the correct permissions
file: path={{ web_server_home }}/config state=directory
owner={{ ansible_env.SUDO_USER }} group={{ web_server_group }} mode=0774
- name: Add vagrant user to www-data - name: Add vagrant user to www-data
user: name={{ ansible_env.SUDO_USER }} append=yes groups={{ web_server_group }} user: name={{ ansible_env.SUDO_USER }} append=yes groups={{ web_server_group }}