infra: generate coredns/hosts from stack.toml domain + service list #135

Closed
opened 2026-03-23 23:41:18 +00:00 by kert · 0 comments
Owner

Problem

coredns/hosts has 10+ lines hardcoding 192.168.1.192 and homelab.fhirworx.io subdomains. Adding a new service means editing both compose.yml AND coredns/hosts manually.

Fix

Add a dev/scripts/gen_coredns_hosts.py that:

  1. Reads [platform].domain and [platform].host_ip from stack.toml
  2. Reads the service list from traefik/dynamic/services.yml (or a [platform].services list in stack.toml)
  3. Generates coredns/hosts

Run it in bootstrap or as a pre-commit hook.

Files

  • coredns/hosts (generated, add to .gitignore or check in)
  • coredns/Corefile (use env var for zone name)
  • New: dev/scripts/gen_coredns_hosts.py
## Problem `coredns/hosts` has 10+ lines hardcoding `192.168.1.192` and `homelab.fhirworx.io` subdomains. Adding a new service means editing both `compose.yml` AND `coredns/hosts` manually. ## Fix Add a `dev/scripts/gen_coredns_hosts.py` that: 1. Reads `[platform].domain` and `[platform].host_ip` from `stack.toml` 2. Reads the service list from `traefik/dynamic/services.yml` (or a `[platform].services` list in `stack.toml`) 3. Generates `coredns/hosts` Run it in bootstrap or as a pre-commit hook. ## Files - `coredns/hosts` (generated, add to .gitignore or check in) - `coredns/Corefile` (use env var for zone name) - New: `dev/scripts/gen_coredns_hosts.py`
kert added this to the P18: Config Consolidation — eliminate hardcoded values milestone 2026-03-23 23:41:18 +00:00
kert added the infra label 2026-03-23 23:41:18 +00:00
kert closed this issue 2026-03-23 23:54:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#135