Merge pull request #1731 from anderbubble/dhcp-subnet-and-range

Generates as much of the DHCP subnet as possible
This commit is contained in:
Christian Goll
2025-02-11 14:47:17 +01:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@@ -23,6 +23,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Removed partial support for regex searches in node and profile lists. #1635
### Changed
- DHCP template generates as much of the subnet and range definition as possible. #1469
## v4.6.0rc2, 2025-02-07
### Added

View File

@@ -46,11 +46,15 @@ if exists user-class and option user-class = "iPXE" {
}
{{- end }}
{{- if and .Network .Netmask .Dhcp.RangeStart .Dhcp.RangeEnd }}
{{- if and .Network .Netmask }}
subnet {{.Network}} netmask {{.Netmask}} {
max-lease-time 120;
{{- if and .Dhcp.RangeStart .Dhcp.RangeEnd }}
range {{.Dhcp.RangeStart}} {{.Dhcp.RangeEnd}};
{{- end }}
{{- if .Ipaddr }}
next-server {{.Ipaddr}};
{{- end }}
}
{{- end }}