2014-09-13 22:16:54 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Configure https vhosts
|
2015-12-09 23:25:44 +01:00
|
|
|
template: src=vhost.conf.j2 dest={{ nginx_confd_path }}/{{ item.domain_name }}.conf mode=0644 owner=root group=root
|
2016-03-11 17:53:07 +01:00
|
|
|
with_items: "{{ nginx_vhosts }}"
|
2014-09-13 22:16:54 +02:00
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
|
2015-06-04 22:30:06 +02:00
|
|
|
- name: Generate self-signed TLS cert
|
|
|
|
command: openssl req -x509 -nodes -sha256 -days 365 -subj "/C=SO/ST=SO/L=snakeoil/O=snakeoil/CN=snakeoil" -newkey rsa:2048 -keyout /etc/ssl/private/nginx-snakeoil.key -out /etc/ssl/certs/nginx-snakeoil.crt -extensions v3_ca creates=/etc/ssl/certs/nginx-snakeoil.crt
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
|
2014-09-13 22:16:54 +02:00
|
|
|
- name: Generate 2048-bit dhparam
|
|
|
|
command: openssl dhparam -out dhparam.pem 2048 chdir=/etc/ssl/certs creates=dhparam.pem
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
|
|
|
|
- name: Create vhost document roots
|
2015-12-09 23:25:44 +01:00
|
|
|
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory mode=0755 owner=nginx group=nginx
|
2016-03-11 17:53:07 +01:00
|
|
|
with_items: "{{ nginx_vhosts }}"
|
2014-09-13 22:16:54 +02:00
|
|
|
|
2015-02-26 15:39:17 +01:00
|
|
|
- name: Install WordPress
|
2016-08-17 10:39:10 +02:00
|
|
|
git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.domain_name }}/wordpress version={{ item.wordpress_version }} depth=1 force=yes
|
2015-02-26 15:39:17 +01:00
|
|
|
when: item.has_wordpress == 'yes'
|
2016-03-11 17:53:07 +01:00
|
|
|
with_items: "{{ nginx_vhosts }}"
|
2015-02-26 15:39:17 +01:00
|
|
|
tags: wordpress
|
|
|
|
|
2015-12-08 15:58:28 +01:00
|
|
|
- name: Fix WordPress directory permissions
|
2015-12-09 23:25:44 +01:00
|
|
|
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=nginx group=nginx recurse=yes
|
2015-12-08 15:58:28 +01:00
|
|
|
when: item.has_wordpress == 'yes'
|
2016-03-11 17:53:07 +01:00
|
|
|
with_items: "{{ nginx_vhosts }}"
|
2015-12-08 15:58:28 +01:00
|
|
|
tags: wordpress
|
|
|
|
|
2016-06-27 22:52:39 +02:00
|
|
|
- include: letsencrypt.yml
|
|
|
|
when: use_letsencrypt == 'yes'
|
|
|
|
tags: letsencrypt
|
|
|
|
|
2014-09-13 22:16:54 +02:00
|
|
|
# vim: set ts=2 sw=2:
|