From 296373581000236ba1380646cc1c36426602fee9 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sat, 8 Nov 2025 03:12:23 +0100 Subject: [PATCH] Use arrays for kernel args and dns --- nodes/_defaults.yaml | 19 ++++++++++++++++--- templates/boot.ipxe | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/nodes/_defaults.yaml b/nodes/_defaults.yaml index 725efc0..0f00b08 100644 --- a/nodes/_defaults.yaml +++ b/nodes/_defaults.yaml @@ -1,8 +1,21 @@ schematicID: !schematic "_schematic.yaml" arch: amd64 talosVersion: v1.11.3 -kernelArgs: talos.platform=metal console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on selinux=1 lockdown=confidentiality -dns0: 1.1.1.1 -dns1: 8.8.8.8 +kernelArgs: + - talos.platform=metal + - console=tty0 + - init_on_alloc=1 + - init_on_free=1 + - slab_nomerge + - pti=on + - consoleblank=0 + - nvme_core.io_timeout=4294967295 + - printk.devkmsg=on + - selinux=1 + - lockdown=confidentiality +extraKernelArgs: [] +dns: + - 1.1.1.1 + - 8.8.8.8 ntp: nl.pool.ntp.org install: false diff --git a/templates/boot.ipxe b/templates/boot.ipxe index bd3c208..dfd96a5 100644 --- a/templates/boot.ipxe +++ b/templates/boot.ipxe @@ -15,8 +15,8 @@ goto node_${serial} || shell {{- 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 }} +{{- $ipArg := printf "ip=%s::%s:%s:%s:%s::%s:%s:%s" .ip .gateway .netmask .hostname .interface (index .dns 0) (index .dns 1) .ntp }} +{{- $kernelArgs := printf "%s %s %s" $ipArg (join .kernelArgs " ") (join .extraKernelArgs " ") }} imgfree kernel https://pxe.factory.talos.dev/image/{{ .schematicID }}/{{ .talosVersion }}/kernel-{{ .arch }} {{ $kernelArgs }} initrd https://pxe.factory.talos.dev/image/{{ .schematicID }}/{{ .talosVersion }}/initramfs-{{ .arch }}.xz