2014-11-18 08:24:39 -05:00
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
sudo: yes
|
2014-11-19 16:27:37 -05:00
|
|
|
vars:
|
|
|
|
rookeries_nginx_conf: rookeries-uwsgi.conf
|
2014-11-19 19:20:27 -05:00
|
|
|
web_server_group: www-data
|
|
|
|
web_server_home: /srv/www
|
2014-11-18 08:24:39 -05:00
|
|
|
tasks:
|
|
|
|
|
2014-11-19 16:27:37 -05:00
|
|
|
- name: Setup nginx webserver
|
|
|
|
apt: pkg=nginx-full state=present
|
2014-11-18 08:24:39 -05:00
|
|
|
|
|
|
|
- name: Configure nginx
|
2014-11-19 16:27:37 -05:00
|
|
|
copy: src=../config/nginx/{{ rookeries_nginx_conf }} dest=/etc/nginx/sites-available
|
2014-11-18 08:24:39 -05:00
|
|
|
|
|
|
|
- name: Link the rookeries uwsgi file
|
|
|
|
file: state=link
|
2014-11-19 16:27:37 -05:00
|
|
|
src=/etc/nginx/sites-available/{{ rookeries_nginx_conf }}
|
|
|
|
path=/etc/nginx/sites-enabled/{{ rookeries_nginx_conf }}
|
2014-11-18 08:24:39 -05:00
|
|
|
|
|
|
|
- name: Unlink the default page
|
|
|
|
file: state=absent path=/etc/nginx/sites-enabled/default
|
|
|
|
|
|
|
|
- name: Run nginx service
|
2014-11-20 08:09:15 -05:00
|
|
|
service: name=nginx state=restarted
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2014-11-19 19:20:27 -05:00
|
|
|
- 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
|
|
|
|
|
2014-11-20 18:05:34 -05:00
|
|
|
- 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
|
|
|
|
|
2014-11-19 19:20:27 -05:00
|
|
|
- name: Add vagrant user to www-data
|
|
|
|
user: name={{ ansible_env.SUDO_USER }} append=yes groups={{ web_server_group }}
|
2014-11-24 08:07:24 -05:00
|
|
|
|
|
|
|
- name: Change permissions on nginx logs
|
|
|
|
file: path=/var/log/nginx state=directory
|
|
|
|
owner={{ web_server_group }} group={{ web_server_group }} mode=0766
|