Add separate ansible playbook for setting up webapp folders.
Add logging configuration for rookeries.
This commit is contained in:
parent
401d0d1b6c
commit
d99bc0edce
|
@ -1,14 +1,18 @@
|
||||||
server {
|
server {
|
||||||
|
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
access_log /srv/www/logs/nginx/rookeries-access.log;
|
||||||
|
error_log /srv/www/logs/nginx/rookeries-error.log info;
|
||||||
|
|
||||||
location /static/ {
|
location /static/ {
|
||||||
alias /srv/www/rookeries_webapp/rookeries/static/;
|
alias /srv/www/rookeries_webapp/rookeries/static/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / { try_files $uri @yourapplication; }
|
location / {
|
||||||
|
try_files $uri @yourapplication;
|
||||||
|
}
|
||||||
location @yourapplication {
|
location @yourapplication {
|
||||||
include uwsgi_params;
|
include uwsgi_params;
|
||||||
uwsgi_pass 127.0.0.1:8001;
|
uwsgi_pass 127.0.0.1:8001;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,5 +2,6 @@
|
||||||
- include: pre_deployment/base_linux.yaml
|
- include: pre_deployment/base_linux.yaml
|
||||||
- include: pre_deployment/python.yaml
|
- include: pre_deployment/python.yaml
|
||||||
- include: pre_deployment/mysql_db.yaml
|
- include: pre_deployment/mysql_db.yaml
|
||||||
|
- include: pre_deployment/web_data_folders.yaml
|
||||||
- include: pre_deployment/nodejs.yaml
|
- include: pre_deployment/nodejs.yaml
|
||||||
- include: pre_deployment/nginx.yaml
|
- include: pre_deployment/nginx.yaml
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
vars:
|
vars:
|
||||||
rookeries_nginx_conf: rookeries-uwsgi.conf
|
rookeries_nginx_conf: rookeries-uwsgi.conf
|
||||||
web_server_group: www-data
|
web_server_group: www-data
|
||||||
web_server_home: /srv/www
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: Setup nginx webserver
|
- name: Setup nginx webserver
|
||||||
|
@ -24,17 +23,6 @@
|
||||||
- name: Run nginx service
|
- name: Run nginx service
|
||||||
service: name=nginx state=restarted
|
service: name=nginx state=restarted
|
||||||
|
|
||||||
- name: Setup webapp deployment folder with the correct permissions
|
|
||||||
file: path={{ web_server_home }} state=directory
|
|
||||||
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
|
|
||||||
user: name={{ ansible_env.SUDO_USER }} append=yes groups={{ web_server_group }}
|
|
||||||
|
|
||||||
- name: Change permissions on nginx logs
|
- name: Change permissions on nginx logs
|
||||||
file: path=/var/log/nginx state=directory
|
file: path=/var/log/nginx state=directory
|
||||||
owner={{ web_server_group }} group={{ web_server_group }} mode=0766
|
owner={{ web_server_group }} group={{ web_server_group }} mode=0766
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
easy_install: name=pip
|
easy_install: name=pip
|
||||||
|
|
||||||
- name: Basic Python dependencies
|
- name: Basic Python dependencies
|
||||||
pip: name={{ item }} use_mirrors=no
|
pip: name={{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
- virtualenv
|
- virtualenv
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
sudo: yes
|
||||||
|
vars:
|
||||||
|
user: "{{ ansible_env.SUDO_USER }}"
|
||||||
|
web_app_home: /srv/www
|
||||||
|
web_server_group: www-data
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: setup webapp deployment folder with the correct permissions
|
||||||
|
file: path={{ web_app_home }} state=directory owner={{ web_server_group }} group=www-data mode=0774
|
||||||
|
|
||||||
|
- name: setup webapp deployment configuration + log folders with the correct permissions
|
||||||
|
file: path={{ web_app_home }}/{{ item }} state=directory
|
||||||
|
owner={{ web_server_group }} group={{ web_server_group }} mode=0774
|
||||||
|
with_items:
|
||||||
|
- config
|
||||||
|
- logs
|
||||||
|
- logs/nginx
|
||||||
|
|
||||||
|
- name: add user to www-data
|
||||||
|
user: name={{ user }} append=yes groups={{ web_server_group }}
|
Loading…
Reference in New Issue