From 1d48c9ce15d68c04af0079e2b290b3223befad1d Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Wed, 29 Sep 2021 22:41:58 -0700 Subject: [PATCH] Removed static port delcaration in the dhcpd templates --- etc/dhcp/default-dhcpd.conf | 2 +- etc/dhcp/static-dhcpd.conf | 2 +- internal/app/wwctl/configure/dhcp/main.go | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/dhcp/default-dhcpd.conf b/etc/dhcp/default-dhcpd.conf index 6ab76b26..eabfb049 100644 --- a/etc/dhcp/default-dhcpd.conf +++ b/etc/dhcp/default-dhcpd.conf @@ -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"; diff --git a/etc/dhcp/static-dhcpd.conf b/etc/dhcp/static-dhcpd.conf index 44af6485..6aa62d4a 100644 --- a/etc/dhcp/static-dhcpd.conf +++ b/etc/dhcp/static-dhcpd.conf @@ -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"; diff --git a/internal/app/wwctl/configure/dhcp/main.go b/internal/app/wwctl/configure/dhcp/main.go index 3281f59a..272cc2fc 100644 --- a/internal/app/wwctl/configure/dhcp/main.go +++ b/internal/app/wwctl/configure/dhcp/main.go @@ -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