fix(verify): retry the nginx VIP assert on transient ARP miss

- convert the verify_from_outside URI assert to register/until/retries/delay
- retry until the MetalLB VIP returns HTTP 200 with the welcome page
- cover the host-only L2 announcement race that failed CI on the shared runner
- add a regression test asserting the retry wiring and hook it into pre-commit
This commit is contained in:
Timothy Stewart
2026-08-14 16:44:38 -05:00
committed by Techno Tim
parent ac77e33be0
commit c8c3609fde
3 changed files with 110 additions and 1 deletions
@@ -69,7 +69,16 @@
url: http://{{ nginx_lb_ip | ansible.utils.ipwrap }}:{{ port_ }}/
return_content: true
register: result
failed_when: "'Welcome to nginx!' not in result.content"
# The MetalLB speaker announces the VIP on the host-only network, and the
# runner may briefly not see it in its ARP table yet. Retry so a transient
# announcement miss does not fail an otherwise healthy cluster, matching
# the load-balancer address wait above and the k3s_server_post metallb waits.
until:
- result.status is defined
- result.status == 200
- "'Welcome to nginx!' in result.content"
retries: 30
delay: 5
vars:
port_: >-
{{ nginx_services.resources[0].spec.ports[0].port }}