Add fleet hostnaming

This commit is contained in:
Audiobuzz
2026-06-19 09:59:49 +00:00
parent 13ac648267
commit 98c71474d3
7 changed files with 116 additions and 0 deletions
+17
View File
@@ -43,6 +43,11 @@ services:
- NET_ADMIN # DHCP raw sockets
- NET_RAW
restart: unless-stopped
volumes:
# DHCP reservations (MAC -> name [-> IP]); drives DHCP option 12 (hostname)
# + DNS A/PTR. Auto-populated by fleet-namer (creative names per MAC); add
# manual lines to pin specific hosts. RW so fleet-namer can append.
- ./dnsmasq/dhcp-hosts:/etc/dnsmasq-hosts
command:
- --keep-in-foreground
# Log to stderr so `docker compose logs` captures output. Without this,
@@ -84,6 +89,18 @@ services:
# below so they sync time internally and never reach the public NTP pool.
# The image's NM dispatcher (10-chrony-dhcp-ntp) feeds this into chrony.
- --dhcp-option=option:ntp-server,${SERVER_IP}
# ---- Per-host names (creative starship hostnames, server-assigned) ----
# The workstation image is hostname-neutral; naming is done HERE. fleet-namer
# (the --dhcp-script) derives a stable themed name per MAC (e.g.
# nebula-vanguard-07), appends it to the hostsfile, and SIGHUPs dnsmasq;
# dnsmasq then sends it as DHCP option 12 (-> NetworkManager sets the
# hostname) and registers DNS A/PTR under ${BOOT_DOMAIN}. The host picks up
# its name on the NEXT DHCP transaction (renewal at ~half lease, or reboot)
# — shorten DHCP_LEASE if you want naming to settle faster on first contact.
# --user=root so the dhcp-script can write the hostsfile + signal dnsmasq.
- --user=root
- --dhcp-hostsfile=/etc/dnsmasq-hosts
- --dhcp-script=/usr/local/bin/fleet-namer
# ---- UEFI HTTP Boot ----
# Firmware sends vendor-class "HTTPClient"; we must echo it back (opt 60)
# and hand over the UKI URL (opt 67). IP in the URL avoids a DNS round-trip