Remove duplicate webapp home variable, to simplify setup.

Remove references to Rookeries and rename variables, to make role useful outside of the context of Rookeries.
This commit is contained in:
Dorian 2015-01-09 07:46:01 -05:00
parent 2e280e0ebc
commit 862d73268a
5 changed files with 21 additions and 21 deletions

View File

@ -3,13 +3,14 @@
apt: pkg=nginx-full state=present apt: pkg=nginx-full state=present
sudo: yes sudo: yes
# TODO Look at using templated configuration
- name: configure nginx - name: configure nginx
copy: src=nginx/{{ rookeries_nginx_conf }} dest=/etc/nginx/sites-available copy: src=nginx/{{ app_nginx_conf }} dest=/etc/nginx/sites-available
- name: enable the rookeries nginx configuration - name: enable the copied over nginx configuration
file: state=link file: state=link
src=/etc/nginx/sites-available/{{ rookeries_nginx_conf }} src=/etc/nginx/sites-available/{{ app_nginx_conf }}
path=/etc/nginx/sites-enabled/{{ rookeries_nginx_conf }} path=/etc/nginx/sites-enabled/{{ app_nginx_conf }}
sudo: yes sudo: yes
- name: disable the default page configuration - name: disable the default page configuration

View File

@ -1,15 +1,15 @@
--- ---
- name: install Python setuptools dependencies - name: install python dev dependencies
sudo: yes sudo: yes
apt: pkg={{ item }} state=present apt: pkg={{ item }} state=present
with_items: with_items:
- python-dev - python-dev
- python-setuptools - python-setuptools
- name: bootstrap PIP using setuptools - name: bootstrap pip using setuptools
sudo: yes sudo: yes
easy_install: name=pip easy_install: name=pip
- name: install Python virtualenv - name: install virtualenv
sudo: yes sudo: yes
pip: name=virtualenv pip: name=virtualenv

View File

@ -3,8 +3,8 @@
pip: name=uwsgi virtualenv={{ uwsgi_venv }} version=2.0 pip: name=uwsgi virtualenv={{ uwsgi_venv }} version=2.0
sudo: yes sudo: yes
- name: upload rookeries configuration - name: upload app's uwsgi configuration
copy: src=uwsgi/{{ rookeries_uwsgi_ini }} dest={{ uwsgi_config }} copy: src=uwsgi/{{ uwsgi_ini }} dest={{ uwsgi_config }}
sudo: yes sudo: yes
- name: restart uwsgi server - name: restart uwsgi server

View File

@ -25,6 +25,6 @@
/var/log/supervisor: logs/supervisor /var/log/supervisor: logs/supervisor
sudo: yes sudo: yes
- name: add user to www-data - name: add user to webserver group
user: name={{ user }} append=yes groups={{ web_server_group }} user: name={{ user }} append=yes groups={{ web_server_group }}
sudo: yes sudo: yes

View File

@ -2,9 +2,14 @@
# vars file for ansible-nginx-uwsgi-supervisor # vars file for ansible-nginx-uwsgi-supervisor
# TODO Make more configurable and flexible # TODO Make more configurable and flexible
# NGINX
rookeries_nginx_conf: rookeries-uwsgi_nginx.conf # Web app home + group
web_app_home: /srv/www
web_server_group: www-data web_server_group: www-data
user: "{{ ansible_env.SUDO_USER }}"
# NGINX
app_nginx_conf: rookeries-uwsgi_nginx.conf
# Supervisor # Supervisor
# TODO Allow for multiple supervisord configurations # TODO Allow for multiple supervisord configurations
@ -12,13 +17,7 @@ supervisor_configs:
# - mailsink_supervisor.conf # - mailsink_supervisor.conf
- rookeries_supervisor.conf - rookeries_supervisor.conf
web_server_home: /srv/www
# UWSGI # UWSGI
uwsgi_venv: "{{ web_server_home }}/virtualenvs/uwsgi" uwsgi_venv: "{{ web_app_home }}/virtualenvs/uwsgi"
uwsgi_config: "{{ web_server_home }}/config/uwsgi" uwsgi_config: "{{ web_app_home }}/config/uwsgi"
rookeries_uwsgi_ini: rookeries-uwsgi.ini uwsgi_ini: rookeries-uwsgi.ini
# Web folders
user: "{{ ansible_env.SUDO_USER }}"
web_app_home: /srv/www