commit ca8bf419ee781a0f93ef661387f92135c102b94c Author: Allen-Kristjan Päll Date: Mon Dec 22 14:29:21 2025 +0200 start diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ee9867c --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +config.json: config.yaml + docker run --rm -i \ + quay.io/coreos/butane:latest \ + --pretty \ + --strict \ + < config.yaml > config.json + +reset: config.json + if [ ! -f config.json ]; then \ + echo "No config.json" && \ + exit 1; \ + fi; \ + TEMPDIR=$$(ssh akpella "cd /tmp && mktemp -d") && \ + scp config.json akpella:$${TEMPDIR} && \ + ssh akpella sudo flatcar-reset \ + --ignition-file $${TEMPDIR}/config.json \ + --keep-machine-id \ + --keep-paths '/etc/ssh/ssh_host_.*' /var/log && \ + ssh akpella sudo systemctl reboot + +update: + VER=$$(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2) && \ + echo $${VER} && \ + ssh akpella sudo flatcar-update -V $${VER} -A diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..3fa6133 --- /dev/null +++ b/config.yaml @@ -0,0 +1,33 @@ +--- +variant: flatcar +version: 1.0.0 + +passwd: + users: + - name: core + ssh_authorized_keys: + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOpw3cIAdtWOYUkb6UOAIcLuRzItoo4oZMzr/hzZYq4E openpgp:0xFAAA0172 + +storage: + files: + # hostname + - path: /etc/hostname + contents: + inline: "akpella.lan" + # network + - path: /etc/systemd/network/00-eth0.network + contents: + inline: | + [Match] + Name=eth0 + + [Network] + DNS=1.1.1.1 + Address=193.40.103.107/24 + Gateway=193.40.103.1 + - path: /etc/hosts + overwrite: true + contents: + inline: | + 127.0.0.1 localhost akpella.lan + ::1 localhost akpella.lan