2014-11-18 08:24:39 -05:00
|
|
|
---
|
2015-01-07 18:23:43 -05:00
|
|
|
- name: install nginx webserver
|
|
|
|
apt: pkg=nginx-full state=present
|
|
|
|
sudo: yes
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2015-01-07 18:23:43 -05:00
|
|
|
- name: configure nginx
|
2015-01-13 22:45:07 -05:00
|
|
|
template: src=nginx/app_uwsgi_nginx.conf dest=/etc/nginx/sites-available/{{ nginx_app_conf }}
|
|
|
|
sudo: yes
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2015-01-13 22:45:07 -05:00
|
|
|
- name: link to enable nginx configuration
|
2015-01-07 18:23:43 -05:00
|
|
|
file: state=link
|
2015-01-13 22:45:07 -05:00
|
|
|
src=/etc/nginx/sites-available/{{ nginx_app_conf }}
|
|
|
|
path=/etc/nginx/sites-enabled/{{ nginx_app_conf }}
|
2015-01-07 18:23:43 -05:00
|
|
|
sudo: yes
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2015-01-13 22:45:07 -05:00
|
|
|
- name: disable default configuration
|
2015-01-07 18:23:43 -05:00
|
|
|
file: state=absent path=/etc/nginx/sites-enabled/default
|
|
|
|
sudo: yes
|
2015-01-15 18:37:26 -05:00
|
|
|
notify: restart nginx
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2015-01-13 22:45:07 -05:00
|
|
|
- name: set nginx directories permissions
|
2015-01-07 18:23:43 -05:00
|
|
|
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
|
|
|
|
sudo: yes
|
2014-11-18 08:24:39 -05:00
|
|
|
|
2015-01-13 22:45:07 -05:00
|
|
|
- name: set nginx logs permissions
|
2015-01-07 18:23:43 -05:00
|
|
|
file: path=/var/log/nginx/{{ item }} state=file
|
|
|
|
owner={{ web_server_group }} group={{ web_server_group }} mode=0644
|
|
|
|
with_items:
|
|
|
|
- access.log
|
|
|
|
- error.log
|
|
|
|
sudo: yes
|