mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-02 07:47:58 +00:00
fix(front-proxy): probe the vhost being deployed, not the primary domain
lookup(tls, <application_id>) 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) <noreply@anthropic.com>
This commit is contained in:
1 parent
c88e50ef17
commit
e9dbcd90ae
1 file changed
+9
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user