71 lines
2.1 KiB
Plaintext
71 lines
2.1 KiB
Plaintext
{{if $.Dhcp.Enabled -}}
|
|
# This file is autogenerated by warewulf
|
|
# Host: {{.BuildHost}}
|
|
# Time: {{.BuildTime}}
|
|
# Source: {{.BuildSource}}
|
|
|
|
allow booting;
|
|
allow bootp;
|
|
ddns-update-style interim;
|
|
authoritative;
|
|
|
|
option space ipxe;
|
|
|
|
# Tell iPXE to not wait for ProxyDHCP requests to speed up boot.
|
|
option ipxe.no-pxedhcp code 176 = unsigned integer 8;
|
|
option ipxe.no-pxedhcp 1;
|
|
|
|
option space PXE;
|
|
option PXE.mtftp-ip code 1 = ip-address;
|
|
option PXE.mtftp-cport code 2 = unsigned integer 16;
|
|
option PXE.mtftp-sport code 3 = unsigned integer 16;
|
|
option PXE.mtftp-tmout code 4 = unsigned integer 8;
|
|
option PXE.mtftp-delay code 5 = unsigned integer 8;
|
|
|
|
option architecture-type code 93 = unsigned integer 16;
|
|
|
|
{{- if eq $.ProfileMap.default.BootMethod.Get "grub" }}
|
|
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
|
|
next-server {{ $.Ipaddr }};
|
|
filename "warewulf/shim.efi";
|
|
} elsif substring (option vendor-class-identifier, 0, 10) = "HTTPClient" {
|
|
filename "http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/grub/shim.efi";
|
|
}
|
|
{{- else }}
|
|
if exists user-class and option user-class = "iPXE" {
|
|
filename "http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/ipxe/${mac:hexhyp}";
|
|
} else {
|
|
{{range $type,$name := $.Tftp.IpxeBinaries }}
|
|
if option architecture-type = {{ $type }} {
|
|
filename "/warewulf/{{ basename $name }}";
|
|
}
|
|
{{- end }}{{/* range IpxeBinaries */}}
|
|
}
|
|
{{- end }}{{/* BootMethod */}}
|
|
|
|
subnet {{$.Network}} netmask {{$.Netmask}} {
|
|
max-lease-time 120;
|
|
range {{$.Dhcp.RangeStart}} {{$.Dhcp.RangeEnd}};
|
|
next-server {{.Ipaddr}};
|
|
}
|
|
{{- range $nodes := $.AllNodes}}
|
|
{{- range $netname, $netdevs := $nodes.NetDevs}}
|
|
host {{$nodes.Id.Get}}-{{$netdevs.Device.Get}}
|
|
{
|
|
{{- if $netdevs.Primary.GetB}}
|
|
{{- if $netdevs.Hwaddr.Defined}}
|
|
hardware ethernet {{$netdevs.Hwaddr.Get}};
|
|
{{- end }}
|
|
{{- if $netdevs.Ipaddr.Defined}}
|
|
fixed-address {{$netdevs.Ipaddr.Get}};
|
|
{{- end }}
|
|
option host-name "{{$nodes.Id.Get}}";
|
|
{{- end }}
|
|
}
|
|
{{end -}}{{/* range NetDevs */}}
|
|
{{end -}}{{/* range AllNodes */}}
|
|
|
|
{{- else}}
|
|
{{abort}}
|
|
{{- end}}{{/* dhcp enabled */}}
|