Restore previous behavior of static dhcp

- Disable dynamic pool when using static dhcp
- Populate configuration of non-primary interfaces for static dhcp

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-06-13 15:41:48 -06:00
parent d374fffa3a
commit f620b7afe2
2 changed files with 4 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix a regression in overlay autobuild. #1216
- Fix wwclient not reading asset-tag. #1110
- Fix dhcp not passing asset tag or uuid to iPXE. #1110
- Restored previous static dhcp behavior. #1263
## v4.5.4, 2024-06-12

View File

@@ -51,8 +51,10 @@ if exists user-class and option user-class = "iPXE" {
subnet {{$.Network}} netmask {{$.Netmask}} {
max-lease-time 120;
{{- if ne .Dhcp.Template "static" }}
range {{$.Dhcp.RangeStart}} {{$.Dhcp.RangeEnd}};
next-server {{.Ipaddr}};
{{- end }}
}
{{- if eq .Dhcp.Template "static" }}
@@ -60,20 +62,19 @@ subnet {{$.Network}} netmask {{$.Netmask}} {
{{- range $netname, $netdevs := $nodes.NetDevs}}
host {{$nodes.Id.Get}}-{{$netname}}
{
{{- if $netdevs.Primary.GetB}}
{{- if $netdevs.Hwaddr.Defined}}
hardware ethernet {{$netdevs.Hwaddr.Get}};
{{- end }}
{{- if $netdevs.Ipaddr.Defined}}
fixed-address {{$netdevs.Ipaddr.Get}};
{{- end }}
{{- if $netdevs.Primary.GetB}}
option host-name "{{$nodes.Id.Get}}";
{{- end }}
}
{{end -}}{{/* range NetDevs */}}
{{end -}}{{/* range AllNodes */}}
{{end -}}{{/* if static */}}
{{- else}}
{{abort}}
{{- end}}{{/* dhcp enabled */}}