Merge pull request #1263 from anderbubble/restore-dhcp-static
Restore previous behavior of static dhcp
This commit is contained in:
@@ -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.6, unreleased
|
||||
|
||||
|
||||
@@ -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 */}}
|
||||
|
||||
Reference in New Issue
Block a user