37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
#!ipxe
|
|
|
|
dhcp
|
|
|
|
: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
|
|
# Default behavior (non install mode) is to exit iPXE script
|
|
|
|
{{ range (datasource "nodes" | jsonArray) }}
|
|
{{- 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 }}
|
|
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
|