src.nth.io/

summaryrefslogtreecommitdiff
path: root/rpi-base/tasks/netplan.yaml
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-08-01 09:53:44 -0500
committerLuke Hoersten <[email protected]>2026-08-01 09:53:44 -0500
commita457c0932b697fd32febe79c473c7e06dccd355a (patch)
treeb5ee3640d2d0f6e2d4a19ccef1ecdee3a243bde9 /rpi-base/tasks/netplan.yaml
parent553be3539fcc475ca91ffed17208b730eef7c331 (diff)
rpi-base: role-owned netplan replaces wpa_supplicant; auto-upgrades gain -updates and 04:00 reboot
Networking: one 40-net.yaml (eth0 always, wifi via rpi_base_wifi_*) with cloud-init's 50-cloud-init.yaml deleted after first boot. cloud-init still renders it on an instance_id bump, and it sorts later, so editing the card's network-config and bumping meta-data is the headless rescue path. ssh_deletekeys off so a rescue bump keeps the host keys. Auto-updates: periodic switches and local policy merged into one 52unattended-upgrades-local; 50unattended-upgrades stays a distro conffile and debconf's 20auto-upgrades can no longer disable anything.
Diffstat (limited to 'rpi-base/tasks/netplan.yaml')
-rw-r--r--rpi-base/tasks/netplan.yaml25
1 files changed, 25 insertions, 0 deletions
diff --git a/rpi-base/tasks/netplan.yaml b/rpi-base/tasks/netplan.yaml
new file mode 100644
index 0000000..eda0e69
--- /dev/null
+++ b/rpi-base/tasks/netplan.yaml
@@ -0,0 +1,25 @@
+---
+
+# One role-owned netplan file replaces cloud-init's render: eth0 always,
+# wifi when enabled. cloud-init only re-renders on a new instance_id, so
+# the deletion below sticks across reboots.
+#
+# RESCUE a dark pi: on the card's FAT partition, edit network-config (a
+# phone hotspot entry works) and bump instance_id in meta-data, then
+# boot. The re-rendered 50-cloud-init.yaml sorts after 40-net.yaml and
+# overrides it; the next playbook run deletes it again.
+- name: install netplan config
+ become: yes
+ template: src="40-net.yaml.j2" dest="/etc/netplan/40-net.yaml" mode="0600"
+ notify: apply netplan
+
+- name: remove the cloud-init netplan config
+ become: yes
+ file: path="/etc/netplan/50-cloud-init.yaml" state="absent"
+ notify: apply netplan
+
+# A rescue instance_id bump re-runs cloud-init's ssh module, which by
+# default deletes and regenerates the host keys; keep them.
+- name: keep ssh host keys on cloud-init re-runs
+ become: yes
+ copy: src="10-rpi-base.cfg" dest="/etc/cloud/cloud.cfg.d/10-rpi-base.cfg"