2014-09-13 22:16:54 +02:00
|
|
|
---
|
|
|
|
|
2018-04-26 09:45:01 +02:00
|
|
|
- block:
|
|
|
|
- name: Configure https vhosts
|
2022-09-10 17:09:12 +02:00
|
|
|
ansible.builtin.template: src=vhost.conf.j2 dest={{ nginx_confd_path }}/{{ item.domain_name }}.conf mode=0644 owner=root group=root
|
2018-04-26 09:45:01 +02:00
|
|
|
loop: "{{ nginx_vhosts }}"
|
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
|
2021-09-27 09:48:24 +02:00
|
|
|
- name: Generate self-signed TLS cert
|
2022-09-10 17:09:12 +02:00
|
|
|
ansible.builtin.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
|
2021-09-27 09:48:24 +02:00
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
|
2021-03-19 12:13:56 +01:00
|
|
|
- name: Download 4096-bit RFC 7919 dhparams
|
2022-09-10 17:09:12 +02:00
|
|
|
ansible.builtin.get_url:
|
2021-03-19 12:13:56 +01:00
|
|
|
url: https://raw.githubusercontent.com/internetstandards/dhe_groups/master/ffdhe4096.pem
|
|
|
|
checksum: sha256:64852d6890ff9e62eecd1ee89c72af9af244dfef5b853bcedea3dfd7aade22b3
|
2021-03-19 17:13:37 +01:00
|
|
|
dest: "{{ nginx_ssl_dhparam }}"
|
2018-04-26 09:45:01 +02:00
|
|
|
notify:
|
|
|
|
- reload nginx
|
|
|
|
|
2021-09-27 11:05:53 +02:00
|
|
|
# TODO: this could break because we can override the document root in host vars
|
2018-04-26 09:45:01 +02:00
|
|
|
- name: Create vhost document roots
|
2022-09-10 17:09:12 +02:00
|
|
|
ansible.builtin.file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory mode=0755 owner=nginx group=nginx
|
2018-04-26 09:45:01 +02:00
|
|
|
loop: "{{ nginx_vhosts }}"
|
|
|
|
tags: nginx
|
2016-06-27 22:52:39 +02:00
|
|
|
|
2014-09-13 22:16:54 +02:00
|
|
|
# vim: set ts=2 sw=2:
|