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
|
|
|
|
apt_repository: repo="deb http://nginx.org/packages/ubuntu/ {{ ansible_distribution_release }} nginx" state=present
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Install nginx
|
|
|
|
apt: pkg=nginx update_cache=yes
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Copy nginx config
|
|
|
|
copy: src={{ item }} dest=/etc/nginx/{{ item }} mode=0644 owner=root group=root
|
|
|
|
with_items:
|
|
|
|
- nginx.conf
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Remove default nginx vhost
|
|
|
|
file: path=/etc/nginx/conf.d/default.conf state=absent
|
|
|
|
tags: nginx
|
|
|
|
|
|
|
|
- name: Configure nginx vhosts
|
2014-08-27 19:03:34 +02:00
|
|
|
template: src=vhost.conf.j2 dest={{ nginx_confd_path }}/{{ item.nginx_domain_name }}.conf mode=0644 owner=root group=root
|
|
|
|
with_items: nginx_vhosts
|
2014-08-16 23:35:57 +02:00
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
tags: nginx
|
|
|
|
|
2014-08-27 19:03:34 +02:00
|
|
|
- name: Create vhost document roots
|
|
|
|
file: path={{ nginx_root_prefix }}/{{ item.nginx_domain_name }} state=directory mode=0755 owner=nginx group=nginx
|
|
|
|
with_items: nginx_vhosts
|
|
|
|
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: Generate 2048-bit dhparam
|
|
|
|
command: openssl dhparam -out dhparam.pem 2048 chdir=/etc/ssl/certs creates=dhparam.pem
|
|
|
|
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:
|