Cleanup and improvements
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $tftpIp := (ds "dhcp").tftpIp -}}
|
||||
{{ $tftpIp := (ds "config").dhcp.tftpIp -}}
|
||||
|
||||
enable-tftp
|
||||
tftp-root=/tftproot
|
||||
|
||||
Reference in New Issue
Block a user