From 40bd3cf30e06a584f010557e54c6e9f74f1d6855 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Thu, 16 Nov 2017 19:02:26 +0100 Subject: [PATCH] Cleanup web-gw and nginx --- roles/nginx/templates/default.j2 | 2 +- roles/web-gw/tasks/main.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/nginx/templates/default.j2 b/roles/nginx/templates/default.j2 index 70b6298..2d6eefe 100644 --- a/roles/nginx/templates/default.j2 +++ b/roles/nginx/templates/default.j2 @@ -14,7 +14,7 @@ server { location / { return 301 https://$host$request_uri; - } + } } server { diff --git a/roles/web-gw/tasks/main.yml b/roles/web-gw/tasks/main.yml index 36a824a..bdd84f4 100644 --- a/roles/web-gw/tasks/main.yml +++ b/roles/web-gw/tasks/main.yml @@ -4,6 +4,9 @@ command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt -days 730 -subj "/CN={{ ansible_fqdn }}" creates=/etc/nginx/ssl/{{ ansible_fqdn }}.crt notify: Restart nginx +- name: Create web content directory + file: path=/var/www/html state=directory mode=0750 + - name: Configure certificate manager template: src=certs.j2 dest=/etc/acme/domains.d/{{ ansible_fqdn }}.conf notify: Run certmgr