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
|
2016-08-14 15:33:48 +02:00
|
|
|
tags: nginx, packages
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2015-05-24 23:15:49 +02:00
|
|
|
- name: Add nginx.org repo
|
2015-08-23 12:24:43 +02:00
|
|
|
template: src=nginx_org_sources.list.j2 dest=/etc/apt/sources.list.d/nginx_org_sources.list owner=root group=root mode=0644
|
2016-08-14 15:33:48 +02:00
|
|
|
tags: nginx, packages
|
2014-08-16 23:35:57 +02:00
|
|
|
|
|
|
|
- name: Install nginx
|
2016-08-22 14:33:57 +02:00
|
|
|
apt: pkg=nginx update_cache=yes state=latest cache_valid_time=3600
|
2016-08-14 15:33:48 +02:00
|
|
|
tags: nginx, packages
|
2014-08-16 23:35:57 +02:00
|
|
|
|
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
|
2016-04-15 11:29:35 +02:00
|
|
|
tags: nginx
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2015-12-09 23:14:47 +01:00
|
|
|
- include: vhosts.yml
|
|
|
|
when: nginx_vhosts is defined
|
2014-08-27 19:03:34 +02:00
|
|
|
tags: nginx
|
|
|
|
|
2015-06-04 22:30:06 +02:00
|
|
|
- name: Configure blank nginx vhost
|
|
|
|
template: src=blank-vhost.conf.j2 dest={{ nginx_confd_path }}/blank-vhost.conf mode=0644 owner=root group=root
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
2015-06-05 23:05:09 +02:00
|
|
|
tags: nginx
|
2015-06-04 22:30:06 +02:00
|
|
|
|
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
|
|
|
|
|
2016-06-27 18:13:20 +02:00
|
|
|
- name: Start and enable nginx service
|
2014-08-16 23:35:57 +02:00
|
|
|
service: name=nginx state=started enabled=yes
|
|
|
|
tags: nginx
|
2014-08-27 19:00:42 +02:00
|
|
|
|
|
|
|
# vim: set ts=2 sw=2:
|