Removed static port delcaration in the dhcpd templates

This commit is contained in:
Gregory Kurtzer
2021-09-29 22:41:58 -07:00
parent 4a0e07f333
commit 1d48c9ce15
3 changed files with 5 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ option ipxe.no-pxedhcp 1;
option architecture-type code 93 = unsigned integer 16;
if exists user-class and option user-class = "iPXE" {
filename "http://{{$.Ipaddr}}:9873/ipxe/${mac:hexhyp}";
filename "http://{{$.Ipaddr}}:{{.Port}}/ipxe/${mac:hexhyp}";
} else {
if option architecture-type = 00:0B {
filename "/warewulf/arm64.efi";

View File

@@ -16,7 +16,7 @@ option ipxe.no-pxedhcp 1;
option architecture-type code 93 = unsigned integer 16;
if exists user-class and option user-class = "iPXE" {
filename "http://{{$.Ipaddr}}:9873/ipxe/${mac:hexhyp}";
filename "http://{{$.Ipaddr}}:{{.Port}}/ipxe/${mac:hexhyp}";
} else {
if option architecture-type = 00:0B {
filename "/warewulf/arm64.efi";

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path"
"strconv"
"strings"
"text/template"
@@ -17,6 +18,7 @@ import (
type dhcpTemplate struct {
Ipaddr string
Port string
RangeStart string
RangeEnd string
Network string
@@ -98,6 +100,7 @@ func Configure(show bool) error {
}
d.Ipaddr = controller.Ipaddr
d.Port = strconv.Itoa(controller.Warewulf.Port)
d.Network = controller.Network
d.Netmask = controller.Netmask
d.RangeStart = controller.Dhcp.RangeStart