2014-08-16 23:35:57 +02:00
|
|
|
---
|
|
|
|
- name: Add nginx.org apt signing key
|
|
|
|
apt_key: url=http://nginx.org/keys/nginx_signing.key state=present
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Add nginx.org stable repo
|
2014-11-06 23:02:44 +01:00
|
|
|
apt_repository: repo="deb http://nginx.org/packages/mainline/ubuntu/ {{ ansible_distribution_release }} nginx" state=present
|
2014-08-16 23:35:57 +02:00
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Install nginx
|
2014-12-02 16:48:11 +01:00
|
|
|
apt: pkg=nginx update_cache=yes state=latest
|
2014-08-16 23:35:57 +02:00
|
|
|
tags: nginx
|
|
|
|
|
2015-01-24 11:05:42 +01:00
|
|
|
- name: Copy nginx configs
|
2014-08-16 23:35:57 +02:00
|
|
|
copy: src={{ item }} dest=/etc/nginx/{{ item }} mode=0644 owner=root group=root
|
|
|
|
with_items:
|
2015-01-24 11:05:42 +01:00
|
|
|
- extra-security.conf
|
2015-02-10 21:04:28 +01:00
|
|
|
- fastcgi_cache
|
2014-08-16 23:35:57 +02:00
|
|
|
- nginx.conf
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Remove default nginx vhost
|
|
|
|
file: path=/etc/nginx/conf.d/default.conf state=absent
|
|
|
|
tags: nginx
|
|
|
|
|
2015-02-19 16:49:39 +01:00
|
|
|
- name: Create fastcgi cache dir
|
|
|
|
file: path=/var/cache/nginx/cached/fastcgi state=directory owner=nginx group=nginx mode=0755
|
|
|
|
tags: nginx
|
|
|
|
|
2014-09-13 22:16:54 +02:00
|
|
|
- include: vhosts.yml
|
|
|
|
when: nginx_vhosts is defined
|
2014-08-16 23:35:57 +02:00
|
|
|
tags: nginx
|
|
|
|
|
2014-09-13 22:16:54 +02:00
|
|
|
- include: tls_vhosts.yml
|
|
|
|
when: nginx_tls_vhosts is defined
|
2014-08-27 19:03:34 +02:00
|
|
|
tags: nginx
|
|
|
|
|
2014-08-16 23:35:57 +02:00
|
|
|
- name: Configure munin vhost
|
|
|
|
copy: src=munin.conf dest=/etc/nginx/conf.d/munin.conf mode=0644 owner=root group=root
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Start & enable nginx service
|
|
|
|
service: name=nginx state=started enabled=yes
|
|
|
|
tags: nginx
|
2014-08-27 19:00:42 +02:00
|
|
|
|
|
|
|
# vim: set ts=2 sw=2:
|