From 06611f562810b5f1fd9240509e813dc1ee31b2bd Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 1 Jan 2021 02:52:42 +0100 Subject: [PATCH] improve website collection --- host_vars/web01.l3d.space.yml | 5 +++++ hosts.ini | 3 +++ site.yml | 6 ++++++ .../files/nginx/sites/ansible.l3d.space_tls.conf | 14 ++++++++++++++ templates/files/nginx/sites/l3d.space_tls.conf | 14 ++++++++++++++ .../nginx/sites/www.ansible.l3d.space_tls.conf | 14 ++++++++++++++ templates/files/nginx/sites/www.l3d.space_tls.conf | 14 ++++++++++++++ 7 files changed, 70 insertions(+) create mode 100644 templates/files/nginx/sites/ansible.l3d.space_tls.conf create mode 100644 templates/files/nginx/sites/l3d.space_tls.conf create mode 100644 templates/files/nginx/sites/www.ansible.l3d.space_tls.conf create mode 100644 templates/files/nginx/sites/www.l3d.space_tls.conf diff --git a/host_vars/web01.l3d.space.yml b/host_vars/web01.l3d.space.yml index c6ca25d..09c1b39 100644 --- a/host_vars/web01.l3d.space.yml +++ b/host_vars/web01.l3d.space.yml @@ -31,6 +31,11 @@ nginx_sites: - name: 'www.c3woc.eu' - name: 'c3woc.cn' - name: 'www.c3woc.cn' + - name: 'l3d.space' + - name: 'www.l3d.space' + - name: 'ansible.l3d.space' + - name: 'www.ansible.l3d.space' + acme_notification_email: "acme_{{ inventory_hostname }}@l3d.yt" diff --git a/hosts.ini b/hosts.ini index 8a09625..500c784 100644 --- a/hosts.ini +++ b/hosts.ini @@ -1,2 +1,5 @@ [web] web01.l3d.space + +[mail] +mail01.l3d.space diff --git a/site.yml b/site.yml index 7cfd99d..0e6ad38 100644 --- a/site.yml +++ b/site.yml @@ -25,3 +25,9 @@ - { role: acmetool2, tags: [web,acmetool]} - { role: nginx2, tags: [web,nginx]} - { role: goaccess, tags: [web,goaccess]} + +#- name: deploy mail config +# hosts: mail +# roles: +# - { role: postfix, tags: [mail,postfix]} +# - { role: dovecot, tags: [mail,dovecot]} diff --git a/templates/files/nginx/sites/ansible.l3d.space_tls.conf b/templates/files/nginx/sites/ansible.l3d.space_tls.conf new file mode 100644 index 0000000..3f3ad50 --- /dev/null +++ b/templates/files/nginx/sites/ansible.l3d.space_tls.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name ansible.l3d.space; + + include snippets/tls_parameters_{{ site.name }}.snippet.conf; + include snippets/tls_certificate_{{ site.name }}.snippet.conf; + include snippets/logging_{{ site.name }}.snippet.conf; + + location / { + return 308 https://github.com/roles-ansible/; + } +} diff --git a/templates/files/nginx/sites/l3d.space_tls.conf b/templates/files/nginx/sites/l3d.space_tls.conf new file mode 100644 index 0000000..0611902 --- /dev/null +++ b/templates/files/nginx/sites/l3d.space_tls.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name l3d.space; + + include snippets/tls_parameters_{{ site.name }}.snippet.conf; + include snippets/tls_certificate_{{ site.name }}.snippet.conf; + include snippets/logging_{{ site.name }}.snippet.conf; + + location / { + return 418; + } +} diff --git a/templates/files/nginx/sites/www.ansible.l3d.space_tls.conf b/templates/files/nginx/sites/www.ansible.l3d.space_tls.conf new file mode 100644 index 0000000..98c35fb --- /dev/null +++ b/templates/files/nginx/sites/www.ansible.l3d.space_tls.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name www.ansible.l3d.space; + + include snippets/tls_parameters_{{ site.name }}.snippet.conf; + include snippets/tls_certificate_{{ site.name }}.snippet.conf; + include snippets/logging_{{ site.name }}.snippet.conf; + + location / { + return 308 https://github.com/roles-ansible/; + } +} diff --git a/templates/files/nginx/sites/www.l3d.space_tls.conf b/templates/files/nginx/sites/www.l3d.space_tls.conf new file mode 100644 index 0000000..995c151 --- /dev/null +++ b/templates/files/nginx/sites/www.l3d.space_tls.conf @@ -0,0 +1,14 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name www.l3d.space; + + include snippets/tls_parameters_{{ site.name }}.snippet.conf; + include snippets/tls_certificate_{{ site.name }}.snippet.conf; + include snippets/logging_{{ site.name }}.snippet.conf; + + location / { + return 418; + } +}