From ad7d4011dcdf434c985d1eb3ee7335797ca0734b Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Mon, 24 Nov 2014 08:07:24 -0500 Subject: [PATCH] Fix up nginx configuration. Remove Fabric remains. --- config/nginx/rookeries-uwsgi.conf | 2 +- deployment/rookeries_install.yaml | 4 ++++ deployment/supervisor.yaml | 1 + pre_deployment/nginx.yaml | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/nginx/rookeries-uwsgi.conf b/config/nginx/rookeries-uwsgi.conf index a31d22f..9de9165 100644 --- a/config/nginx/rookeries-uwsgi.conf +++ b/config/nginx/rookeries-uwsgi.conf @@ -3,7 +3,7 @@ server { server_name localhost; location /static/ { - alias /var/www/rookeries/static/; + alias /srv/www/rookeries/rookeries/static/; } location / { try_files $uri @yourapplication; } diff --git a/deployment/rookeries_install.yaml b/deployment/rookeries_install.yaml index 4a874a3..936be27 100644 --- a/deployment/rookeries_install.yaml +++ b/deployment/rookeries_install.yaml @@ -17,4 +17,8 @@ pip: name=mysql-connector-python virtualenv={{ rookeries_venv }} version=1.1.6 extra_args='--allow-external mysql-connector-python --allow-unverified mysql-connector-python' + # TODO This is problematic, and maybe a good sign why deploying a web app via pip isn't the wisest idea. + - name: Link rookeries static pages to top-level of virtualenv + file: src={{ rookeries_venv }}/lib/python2.7/site-packages/rookeries/ dest={{ rookeries_venv }}/rookeries state=link + # TODO Step 4 - Setup environment variables on target system related to config. diff --git a/deployment/supervisor.yaml b/deployment/supervisor.yaml index f1f99f7..9c41f31 100644 --- a/deployment/supervisor.yaml +++ b/deployment/supervisor.yaml @@ -24,6 +24,7 @@ - supervisord - supervisorctl + # TODO Separate out starting and stopping of supervisord + supervisorctl outside of provisioning - name: Check if supervisord is running shell: pgrep supervisor ignore_errors: on diff --git a/pre_deployment/nginx.yaml b/pre_deployment/nginx.yaml index f0a501a..763008e 100644 --- a/pre_deployment/nginx.yaml +++ b/pre_deployment/nginx.yaml @@ -34,3 +34,7 @@ - name: Add vagrant user to www-data user: name={{ ansible_env.SUDO_USER }} append=yes groups={{ web_server_group }} + + - name: Change permissions on nginx logs + file: path=/var/log/nginx state=directory + owner={{ web_server_group }} group={{ web_server_group }} mode=0766