2014-11-18 08:24:39 -05:00
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
sudo: yes
|
2014-11-19 16:27:37 -05:00
|
|
|
vars:
|
2014-11-28 07:48:15 -05:00
|
|
|
rookeries_nginx_conf: rookeries-uwsgi_nginx.conf
|
2014-11-19 19:20:27 -05:00
|
|
|
web_server_group: www-data
|
2014-11-18 08:24:39 -05:00
|
|
|
tasks:
|
|
|
|
|
2014-12-03 22:09:38 -05:00
|
|
|
- name: install nginx webserver
|
2014-11-19 16:27:37 -05:00
|
|
|
apt: pkg=nginx-full state=present
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2014-12-03 22:09:38 -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
|
|
|
|
2014-12-03 22:09:38 -05:00
|
|
|
- name: enable the rookeries nginx configuration
|
2014-11-18 08:24:39 -05:00
|
|
|
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
|
|
|
|
2014-12-03 22:09:38 -05:00
|
|
|
- name: disable the default page configuration
|
2014-11-18 08:24:39 -05:00
|
|
|
file: state=absent path=/etc/nginx/sites-enabled/default
|
|
|
|
|
2014-12-03 22:09:38 -05:00
|
|
|
- name: restart nginx
|
2014-11-20 08:09:15 -05:00
|
|
|
service: name=nginx state=restarted
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2014-12-04 07:50:50 -05:00
|
|
|
- name: set permissions on nginx config + log directories
|
|
|
|
file: path={{ item }} state=directory
|
|
|
|
group={{ web_server_group }} mode=0755
|
|
|
|
with_items:
|
|
|
|
- /var/log/nginx
|
|
|
|
- /etc/nginx
|
|
|
|
- /etc/nginx/sites-available
|
|
|
|
- /etc/nginx/sites-enabled
|
2014-12-03 22:09:38 -05:00
|
|
|
|
|
|
|
- name: set permissions on nginx logs
|
|
|
|
file: path=/var/log/nginx/{{ item }} state=file
|
|
|
|
owner={{ web_server_group }} group={{ web_server_group }} mode=0644
|
|
|
|
with_items:
|
|
|
|
- access.log
|
|
|
|
- error.log
|