Cleanup and improvements

This commit is contained in:
2025-11-07 21:15:29 +01:00
parent 6cb1c7d48b
commit 8c53b59671
22 changed files with 263 additions and 151 deletions

View File

@@ -2,35 +2,24 @@
dhcp
echo Starting ${serial}
:start
# Is a known serial is set, execute that
# If an unknown serial is set, exit
# If no serial is set, ask the user
goto node_${serial} || goto manual
goto node_${serial} || shell
# Default behavior (non install mode) is to exit iPXE script
{{ range (datasource "nodes" | jsonArray) }}
{{ range datasource "nodes" }}
{{- if .install }}
# {{ .filename }}
:node_{{ .serial }}
{{- $ipArg := printf "ip=%s::%s:%s:%s:%s::%s:%s:%s" .ip .gateway .netmask .hostname .interface .dns0 .dns1 .ntp }}
{{- $kernelArgs := printf "%s %s" $ipArg .kernelArgs }}
imgfree
kernel https://pxe.factory.talos.dev/image/{{ .schematicID }}/{{ .talosVersion }}/kernel-{{ .arch }} {{ $kernelArgs }} {{- if .upgradeIPXE }} || boot {{ .upgradeIPXE }} {{- end }}
kernel https://pxe.factory.talos.dev/image/{{ .schematicID }}/{{ .talosVersion }}/kernel-{{ .arch }} {{ $kernelArgs }}
initrd https://pxe.factory.talos.dev/image/{{ .schematicID }}/{{ .talosVersion }}/initramfs-{{ .arch }}.xz
boot
{{- end }}
{{ end }}
:manual
menu Select node
{{ range (datasource "nodes" | jsonArray) }}
item {{ .serial }} {{ .hostname }}
{{ end }}
choose selected || goto cancel
goto node_${selected}
:cancel
echo Type exit to restart script
shell
goto start