fix: runner DNS resolution and stale registration data

Fix etc_hosts templating so the runner resolves the gitea domain to
the private IP. Clear runner data volume on deploy to avoid stale
registration errors when the token changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 22:00:25 -04:00
parent 04ca230bee
commit 539f8cda2f
2 changed files with 80 additions and 75 deletions

View File

@@ -96,8 +96,14 @@
- ../vault.yml
- ../dist/terraform_outputs.yml
vars:
gitea_internal_url: "https://{{ server_fqdn.value }}"
gitea_hostname: "{{ server_fqdn.value }}"
gitea_internal_url: "https://{{ gitea_hostname }}"
tasks:
- name: Remove stale runner data.
community.docker.docker_volume:
name: runner-data
state: absent
- name: Create runner data volume.
community.docker.docker_volume:
name: runner-data
@@ -118,8 +124,7 @@
state: started
recreate: true
restart_policy: unless-stopped
etc_hosts:
"{{ server_fqdn.value }}": "10.0.1.2"
etc_hosts: "{{ {gitea_hostname: '10.0.1.2'} }}"
volumes:
- runner-data:/data
- /var/run/docker.sock:/var/run/docker.sock