Files
computer-playbook/roles/sys-svc-container/handlers/main.yml
kevinveenbirkenbachandClaude Opus 5 ce43263745 fix(container-dns): follow the live bridge, not a configured address
The swarm inventory carried the manager's docker bridge gateway as a literal under networks.internet.dns, so one field meant two things at once and the value went stale the moment default-address-pools moved the bridge. The daemon kept handing out the new address while the inventory kept naming the old one, and the DinD diagnostic probed that same literal, so it failed in step with the defect instead of catching it.

The inventory now declares only the clearnet resolver. The lookup hands containers the bridge whenever the host resolves solely through a loopback listener, which is how the simulated cluster nodes are wired and which docker strips from a container's resolv.conf. The diagnostic reads the gateway from the running daemon instead of being told it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 00:06:42 +02:00

24 lines
944 B
YAML

---
- name: 🔄 Ensure Docker daemon is running on host
ansible.builtin.service:
name: docker.service
state: restarted
enabled: true
listen: container-manager-restart
- name: 💬 Ensure Docker-In-Docker DNS works
ansible.builtin.script: "{{ role_path }}/files/shell/test-dns.sh"
register: docker_in_docker_dns_check
until: docker_in_docker_dns_check is succeeded
retries: 7
delay: 20
listen: container-manager-restart
when:
- DOCKER_IN_CONTAINER | bool
- networks.internet.dns | length > 0
environment:
BUSYBOX_IMAGE: "{{ lookup('config', 'sys-svc-container', 'services.busybox.image') }}:{{ lookup('config', 'sys-svc-container', 'services.busybox.version') }}"
NODE_IMAGE: "{{ '' if DEPLOYMENT_MODE == 'swarm' else lookup('config', 'sys-svc-container', 'services.node.image') ~ ':' ~ lookup('config', 'sys-svc-container',
'services.node.version') }}"
DOMAIN: "{{ DOMAIN_PRIMARY }}"