From e9dbcd90aef2ff981cbc309f09822e116e94da1d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 4 Sep 2026 17:36:03 +0200 Subject: [PATCH] fix(front-proxy): probe the vhost being deployed, not the primary domain lookup(tls, ) resolves through resolve_primary_domain_from_app, so every iteration of a multi-vhost loop probed the same primary domain. For seaweedfs that meant checking s3. three times and filer. and master. never, right after writing their vhosts. Passing the domain instead returns it unchanged (utils/tls_common.py:221-227). Resolve the probe URL and the accepted status codes from that one term in a second set_fact, so the URL and the codes cannot disagree even when the lookup falls back to the primary domain. Co-Authored-By: Claude Opus 5 (1M context) --- roles/sys-stk-front-proxy/tasks/main.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/sys-stk-front-proxy/tasks/main.yml b/roles/sys-stk-front-proxy/tasks/main.yml index ab066a945a..70e6e82c11 100644 --- a/roles/sys-stk-front-proxy/tasks/main.yml +++ b/roles/sys-stk-front-proxy/tasks/main.yml @@ -35,7 +35,6 @@ ) ) }} - front_proxy_status_codes: "{{ lookup('applications') | accepted_status_codes(application_id, lookup('tls', application_id, 'domain')) }}" front_proxy_domain_conf_dst_resolved: >- {{ lookup( @@ -46,6 +45,12 @@ }} changed_when: false +- name: 🧊 Freeze the probe target for this vhost + ansible.builtin.set_fact: + front_proxy_probe_url: "{{ lookup('tls', front_proxy_domain, 'url.base') }}" + front_proxy_status_codes: "{{ lookup('applications') | accepted_status_codes(front_proxy_application_id, lookup('tls', front_proxy_domain, 'domain')) }}" + changed_when: false + - name: 📂 Include dependencies include_role: name: "sys-svc-nss" @@ -104,9 +109,9 @@ notify: reload-openresty - block: - - name: "🔍 Check if {{ lookup('domain', front_proxy_application_id) }} is reachable" + - name: "🔍 Check if '{{ front_proxy_domain }}' is reachable" uri_probe: - url: "{{ lookup('tls', front_proxy_application_id, 'url.base') }}" + url: "{{ front_proxy_probe_url }}" status_code: "{{ front_proxy_status_codes }}" register: site_check failed_when: false @@ -126,7 +131,7 @@ - name: "🔍 Verify '{{ front_proxy_domain }}' is served after the reload" uri_probe: - url: "{{ lookup('tls', front_proxy_application_id, 'url.base') }}" + url: "{{ front_proxy_probe_url }}" status_code: "{{ front_proxy_status_codes }}" register: front_proxy_reload_check failed_when: false