Files
computer-playbook/roles/web-app-gitlab/tasks/02_wait/wait_one.yml
kevinveenbirkenbachandClaude Opus 5 673e994aa7 feat(lint): pin type and resolver on every container inspect
An untyped inspect searches every docker object kind, and a role's overlay network carries the same entity name as its main container, so the call can resolve the network and report a missing State key instead of naming the container. That is how the openresty assert died on every swarm job of run 30709070050.

Extend container-exec-resolver to cover inspect, stripping raw markers and quoted spans first so the flag walker survives Go template format strings. Add container-inspect-type, scoped to roles/ because the collision follows the entity naming convention and the outer act namespace carries no role networks. Sweep 40 call sites; suppress the delegate_to-resolved CIDs and the compose co-location probes with a stated reason.

Move the five container rules into tests/lint/ansible/shell/container/ and drop the container_ prefix from their filenames. Register both markers in the suppression docs, where the resolver marker was missing entirely.

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

19 lines
768 B
YAML

---
- name: "🔍 Resolve '{{ item }}' hosting node + container id"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: "{{ item }}"
resolve_output_prefix: GITLAB_WAIT
resolve_compose_cid: "{{ lookup('container_address', application_id, item) }}"
- name: "🔎 Check health status of '{{ item }}' container"
ansible.builtin.shell: >
container inspect --type container --format '{{ "{{.State.Health.Status}}" }}'
{{ GITLAB_WAIT_LOCAL_CID | quote }}
register: healthcheck
retries: 90
delay: 10
until: healthcheck.rc == 0 and (healthcheck.stdout | trim) == "healthy"
changed_when: false
delegate_to: "{{ GITLAB_WAIT_HOST_NODE }}"