From 9569c46210348340ecf552c3eb3217f21c9fee79 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Wed, 17 Jan 2024 15:08:47 -0700 Subject: [PATCH] Restore functionality of the static dhcp template Signed-off-by: Jonathon Anderson --- overlays/host/etc/dhcp/dhcpd.conf.ww | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/overlays/host/etc/dhcp/dhcpd.conf.ww b/overlays/host/etc/dhcp/dhcpd.conf.ww index 03fe54cb..2ffccb3c 100644 --- a/overlays/host/etc/dhcp/dhcpd.conf.ww +++ b/overlays/host/etc/dhcp/dhcpd.conf.ww @@ -54,9 +54,11 @@ subnet {{$.Network}} netmask {{$.Netmask}} { range {{$.Dhcp.RangeStart}} {{$.Dhcp.RangeEnd}}; next-server {{.Ipaddr}}; } + +{{- if eq .Dhcp.Template "static" }} {{- range $nodes := $.AllNodes}} {{- range $netname, $netdevs := $nodes.NetDevs}} -host {{$nodes.Id.Get}}-{{$netdevs.Device.Get}} +host {{$nodes.Id.Get}}-{{$netname}} { {{- if $netdevs.Primary.GetB}} {{- if $netdevs.Hwaddr.Defined}} @@ -70,6 +72,7 @@ host {{$nodes.Id.Get}}-{{$netdevs.Device.Get}} } {{end -}}{{/* range NetDevs */}} {{end -}}{{/* range AllNodes */}} +{{end -}}{{/* if static */}} {{- else}} {{abort}}