From 0c4cd283c497ddab8b5460dd421b9798bd881e80 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 12 Aug 2025 14:31:24 +0200 Subject: [PATCH] Optimized CDN variables during bug research --- roles/web-svc-cdn/tasks/01_core.yml | 5 ++--- roles/web-svc-cdn/templates/nginx.conf.j2 | 2 +- roles/web-svc-cdn/vars/main.yml | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/roles/web-svc-cdn/tasks/01_core.yml b/roles/web-svc-cdn/tasks/01_core.yml index 432886ff..63f2ff08 100644 --- a/roles/web-svc-cdn/tasks/01_core.yml +++ b/roles/web-svc-cdn/tasks/01_core.yml @@ -9,11 +9,10 @@ include_role: name: srv-web-7-6-composer vars: - domain: "{{ domains | get_domain(application_id) }}" http_port: "{{ ports.localhost.http[application_id] }}" -- name: "generate {{domains | get_domain(application_id)}}.conf" +- name: "generate '{{ CDN_NGINX_FILE }}'" template: src: "nginx.conf.j2" - dest: "{{ nginx.directories.http.servers }}{{ domains | get_domain(application_id) }}.conf" + dest: "{{ nginx.directories.http.servers }}{{ CDN_NGINX_FILE }}" notify: restart openresty \ No newline at end of file diff --git a/roles/web-svc-cdn/templates/nginx.conf.j2 b/roles/web-svc-cdn/templates/nginx.conf.j2 index 40448b13..0be047ca 100644 --- a/roles/web-svc-cdn/templates/nginx.conf.j2 +++ b/roles/web-svc-cdn/templates/nginx.conf.j2 @@ -1,6 +1,6 @@ server { - server_name {{domains | get_domain(application_id)}}; + server_name {{ domains | get_domain(application_id) }}; {% include 'roles/srv-web-7-7-letsencrypt/templates/ssl_header.j2' %} diff --git a/roles/web-svc-cdn/vars/main.yml b/roles/web-svc-cdn/vars/main.yml index 88b4b9af..e919592b 100644 --- a/roles/web-svc-cdn/vars/main.yml +++ b/roles/web-svc-cdn/vars/main.yml @@ -1,2 +1,6 @@ +# General application_id: "web-svc-cdn" domain: "{{ domains | get_domain(application_id) }}" + +# CDN +CDN_NGINX_FILE: "{{ domain }}.conf"