Monthly Updates With Ansible
How the lab is updated now: one playbook, one host at a time, a canary first, and a kernel check the reboot flag could not give me.
Published November 21, 2026 · Updated December 2, 2026
My old update routine ran on the Proxmox host. A snapshot of every container first, then the host, then each container in a loop. Update And Maintenance is that routine, and I ran it by hand for a long time.
It stopped fitting the lab. There are two nodes and a handful of small boards now, and most of them have no internet of their own.
So the updates come from my Mac: one playbook, run against one host at a time. The plan is once a month. The first full run was on 8 November 2026, across nine hosts, and it took about an hour and three quarters from the first host to the last check. This page is that run, with what it taught me built in.
What The Playbook Does
On each host it does five things:
- Upgrade every package, allowing apt to remove one when it has to. That is what Proxmox asks for: a plain
apt upgradecan leave a Proxmox host half upgraded.1 - On the Pi-hole boards, run Pi-hole's own updater, but only when a part of Pi-hole is behind.
- Look for
/var/run/reboot-required. - If it is there, reboot. Unless the host is a Proxmox node.
- On a Proxmox node with the flag, print a reminder to reboot it by hand.
Every package comes through the package cache, like everything else in the lab.
Apps that are pinned to a version, like the monitoring images, are not apt's business. I bump their pins in their own role, on purpose, and not on update day.
One Host At A Time
I could point the playbook at everything at once. I don't, and the first run showed me three reasons why.
The hosts come in a different order every time. I listed them three times and got three orders. A full run could reboot the proxy, or a node, before the canary has even been tried.
The small boards each have their own sudo password, and one run takes only one. I found that out the direct way: one board failed with Missing sudo password, and I had to run it again.
And with one host per run, a failure shows at once, and nothing after it has changed.
So it is one command per host, with the output kept in a folder for the day:
L=~/lab-update-logs/$(date +%F)
mkdir -p "$L"
ansible-playbook ansible/playbooks/update_all.yml --limit searxng | tee $L/searxng.txtA normal run ends like this:
TASK [Upgrade all packages (apt dist-upgrade)] *********************************
changed: [searxng]
TASK [Check whether a reboot is required] **************************************
ok: [searxng]
TASK [Reboot (not Proxmox nodes)] **********************************************
skipping: [searxng]
PLAY RECAP *********************************************************************
searxng : ok=3 changed=1 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0failed=0 is the line I read. changed=0 is fine too: it means nothing was pending. If a run says failed=1, I fix the cause and run the same host again. I do not go on to the next one.
Before the first host, and after every host, I ask Prometheus one question: is anything down?
curl -s 'http://10.0.50.10:9090/api/v1/query?query=up%3D%3D0%20or%20probe_success%3D%3D0'An empty result means nothing is. Anything else, I stop and fix that first.
The Order
- The canary,
searxng, a small container. If its update goes wrong, nothing else has changed yet. - The other guests, one by one. If Docker itself is among the updates, their apps restart with it.
- The reverse proxy. apt leaves its custom Caddy build alone.
- The two Tailscale routers, one after the other, so one of them is always serving.
- The small boards. The proxy first. Then the Pi-holes, the secondary before the primary, so one of them always answers.
- The node, last. Its guests keep running while it updates. When it needs a reboot, I do that by hand.
That reboot takes the front door and the home hub away for about three minutes, so the household hears about it first. The run sits in an early-afternoon window, and I budget 90 minutes for it.
The Reboot Flag That Never Came
The old routine trusted /var/run/reboot-required. If the file was there, reboot. If not, done.
On the first run the node got a new kernel, and the playbook printed no reminder. So afterwards I looked at which hosts actually write that file. Debian's kernel packages do not. A hook in /etc/kernel/postinst.d/ does, such as the one unattended-upgrades installs. On 8 November 2026 exactly one host in my lab had such a hook: the proxy board.
So on every other host a new kernel could be installed, the flag would stay quiet, and the Proxmox reminder would never print.
The check I use now does not ask the flag. It compares the running kernel with the newest one installed:
r=$(uname -r)
f=$(echo "$r" | sed "s/^[^+]*+//; s/^.*-pve$/-pve/")
n=$(ls /lib/modules | grep -F -- "$f" | sort -V | tail -1)
if [ "$r" = "$n" ]; then
echo "$(hostname): running $r, the newest installed: no reboot"
else
echo "$(hostname): running $r, installed $n: REBOOT DUE"
fiThe second line picks out the kernel's kind, so a Proxmox kernel is only compared with Proxmox kernels, and a Raspberry Pi kernel with Raspberry Pi kernels. Containers are left out: they run their node's kernel.
Reboots, One At A Time
The hosts that are due get rebooted one by one, and the order matters here too: a Pi-hole, then the Tailscale board, then the node last. The node carries the other Tailscale router, so rebooting it while the board is still coming back would take both ways in away at once.
I did not wait long enough the first time. Three reboots started within four minutes, and for one scrape neither Tailscale router answered. Now the next reboot does not start until the checks after the previous one are clean.
For the record, the three reboots that day took 42 seconds for the Pi-hole board, 65 seconds for the Tailscale board, and 157 seconds for the node with its guests.
The GPU Node Gets Its Own Window
The node with the GPUs is not in the monthly run. Two rules keep it out.
The driver module has to be built before the reboot. dkms status must show the NVIDIA module installed for the new kernel before the node boots into it.
And the host and the GPU container have to run the same driver. Today that is 580.178.04, on both.
The PVE 9.2 upgrade in June 2026 is where both rules mattered most.
One more check belongs to that window. The blacklist that keeps the open-source NVIDIA drivers off the GPUs has to be inside the new initramfs. Kernel 7 Boot Hang RCA is why.
Rolling Back
Packages have no undo. A bad package is fixed forward: a newer one, or an older version pinned from the mirror.
A kernel that misbehaves on a Proxmox node is easier. I boot the previous kernel and pin it with proxmox-boot-tool kernel pin <version>, then run proxmox-boot-tool refresh. Without the refresh, the pin does not reach the boot partitions. I unpin once a fixed kernel arrives.2
apt -f install is not a rollback. It retries the same step that failed.
The old routine trusted a flag. This one asks the kernel.
Related Topics
- Update And Maintenance - the old routine, by hand on the host.
- Package Cache On A Raspberry Pi - where every package comes from.
- PVE 9.2 Upgrade Runbook - a major upgrade, which is a window of its own.
- Kernel 7 Boot Hang RCA - why the GPU node's blacklist matters.
- The Lab Is Built From Code - why a playbook at all.
Footnotes
-
Proxmox VE Administration Guide, "System Software Updates": "apt upgrade may result in a partially upgraded or broken package state", because
apt full-upgradecan remove existing packages to satisfy dependencies andapt upgradecannot. ↩ -
Proxmox VE Administration Guide, "Host Bootloader":
proxmox-boot-tool kernel pinpins the system to a kernel version, and after setting or clearing a pin the ESPs must be synchronised with therefreshsubcommand. ↩