mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
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>
18 lines
549 B
YAML
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
|