From e5ca7f59dbbae4cadb73f9a876746bbc5bdcb21a Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Mon, 13 May 2019 20:22:02 +0200 Subject: [PATCH] replace hard coded values by variables --- roles/bk-dss/tasks/main.yml | 2 +- roles/bk-dss/templates/vhost.j2 | 4 ++-- roles/gogs/templates/vhost.j2 | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/roles/bk-dss/tasks/main.yml b/roles/bk-dss/tasks/main.yml index effbfb9..1ce517d 100644 --- a/roles/bk-dss/tasks/main.yml +++ b/roles/bk-dss/tasks/main.yml @@ -30,7 +30,7 @@ notify: Restart uwsgi - name: Ensure certificates are available - command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/dss.binary-kitchen.de.key -out /etc/nginx/ssl/dss.binary-kitchen.de.crt -days 730 -subj "/CN=dss.binary-kitchen.de" creates=/etc/nginx/ssl/dss.binary-kitchen.de.crt + command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ dss_domain }}.key -out /etc/nginx/ssl/{{ dss_domain }}.crt -days 730 -subj "/CN={{ dss_domain }}" creates=/etc/nginx/ssl/{{ dss_domain }}.crt notify: Restart nginx - name: Configure certificate manager diff --git a/roles/bk-dss/templates/vhost.j2 b/roles/bk-dss/templates/vhost.j2 index f797488..32f7fb1 100644 --- a/roles/bk-dss/templates/vhost.j2 +++ b/roles/bk-dss/templates/vhost.j2 @@ -20,8 +20,8 @@ server { server_name {{ dss_domain }}; - ssl_certificate_key /etc/nginx/ssl/dss.binary-kitchen.de.key; - ssl_certificate /etc/nginx/ssl/dss.binary-kitchen.de.crt; + ssl_certificate_key /etc/nginx/ssl/{{ dss_domain }}.key; + ssl_certificate /etc/nginx/ssl/{{ dss_domain }}.crt; location / { uwsgi_pass 127.0.0.1:{{ dss_uwsgi_port }}; diff --git a/roles/gogs/templates/vhost.j2 b/roles/gogs/templates/vhost.j2 index 25c2489..c72aa9b 100644 --- a/roles/gogs/templates/vhost.j2 +++ b/roles/gogs/templates/vhost.j2 @@ -28,5 +28,4 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:3000; } - }