Files
computer-playbook/roles/svc-prx-openresty/tasks/01_assert.yml
kevinveenbirkenbachandClaude Opus 5 c247a6ce26 fix(openresty): probe the assert container via container_address
The readiness probe passed the bare service name to container inspect. In swarm that name does not belong to a container, because compose_only suppresses container_name there, but it does belong to the overlay network, which get_entity_name names identically. Docker resolved the network and failed with a missing State key on every swarm job once MODE_ASSERT armed the include.

Route the probe through OPENRESTY_CONTAINER_ADDRESS like the validation task two lines below, switch to shell so the resolver subshell is evaluated, and pin --type container so a name shared with a network can no longer select the wrong object.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 20:51:56 +02:00

18 lines
549 B
YAML

---
- name: ⏳ Wait until OpenResty container is running
shell: >
container inspect --type container
-f '{{ "{{.State.Running}}" }}' {{ OPENRESTY_CONTAINER_ADDRESS }}
register: openresty_running
changed_when: false
until: openresty_running.stdout | trim == "true"
retries: 24
delay: 5
- name: ✅ Validate OpenResty configuration (Post-Flight-Check)
shell: >
container exec {{ OPENRESTY_CONTAINER_ADDRESS }} openresty -t -q
register: openresty_test_post
changed_when: false
failed_when: openresty_test_post.rc != 0