ansible-nginx-uwsgi-supervisor/pre_deployment/nginx.yaml

29 lines
847 B
YAML

---
- hosts: all
sudo: yes
vars:
rookeries_nginx_conf: rookeries-uwsgi_nginx.conf
web_server_group: www-data
tasks:
- name: Setup nginx webserver
apt: pkg=nginx-full state=present
- name: Configure nginx
copy: src=../config/nginx/{{ rookeries_nginx_conf }} dest=/etc/nginx/sites-available
- name: Link the rookeries uwsgi file
file: state=link
src=/etc/nginx/sites-available/{{ rookeries_nginx_conf }}
path=/etc/nginx/sites-enabled/{{ rookeries_nginx_conf }}
- name: Unlink the default page
file: state=absent path=/etc/nginx/sites-enabled/default
- name: Run nginx service
service: name=nginx state=restarted
- name: Change permissions on nginx logs
file: path=/var/log/nginx state=directory
owner={{ web_server_group }} group={{ web_server_group }} mode=0766