The Playbook That Said ok: A Silent containerd Misconfiguration on Debian 13

In progress Kubernetes Ansible

While rebuilding my homelab from scratch, the playbook that installs containerd finished green on a freshly installed Debian 13 node. Every task was ok, changed or skipped; nothing failed. Yet the one setting the playbook exists for, the systemd cgroup driver, had never been applied. This is how a correct-looking run hid a misconfiguration, and how it was caught before the node joined the cluster.

Impact

  • Actual: none. The node had not joined a cluster yet, and the problem was caught by a manual check right after the run.
  • Potential: once joined, the node would have run containerd with the cgroupfs driver while the kubelet used systemd. That mismatch typically shows up as unstable nodes and pods restarting in a loop, long after the playbook that caused it has been forgotten.
  • Blast radius: every node prepared with this playbook on Debian 13, since all of them install the same package.

Timeline

All times on 2026-11-21.

  • 21:28 - 03-install-containerd.yaml runs on the new GPU node. Recap: ok=9 changed=2 failed=0 skipped=1.
  • 21:28 - Reading the output, two lines stand out: Generate default containerd config was skipped, and Configure SystemdCgroup was ok rather than changed. A fresh install should have changed both.
  • 21:29 - Check on the node: grep SystemdCgroup /etc/containerd/config.toml finds nothing; the file has 9 lines. containerd is 1.7.24~ds1-6+deb13u1.
  • 21:30 - Playbook fixed (see Actions) and re-run: the config is regenerated, the flag is set, an assertion passes, containerd restarts.
  • 21:30 - grep SystemdCgroup shows true. Later, containerd config dump confirms it for both the runc and the NVIDIA runtime.

Root cause

Two reasonable steps combined into a silent no-op:

  1. The generation step was conditional on the file's absence. It ran containerd config default > /etc/containerd/config.toml only when the file didn't exist. Debian's package ships a short stub config.toml without a runc section, so the file existed and generation was skipped (see Debian's containerd Package Ships a Config Stub Without SystemdCgroup).
  2. The edit step could not fail. An ansible.builtin.replace turned SystemdCgroup = false into true. With no such line in the stub, there was nothing to replace, and the module correctly reported ok: its desired state, "no line says false", already held (see An Ansible replace Task That Matches Nothing Reports ok, So Assert the End State).

The playbook had been written and tested against nodes where the file either didn't exist or already held the full default config. The packaged stub was the case nobody had planned for.

Actions

  • Generate the full default config whenever the file does not contain SystemdCgroup, instead of only when the file is missing.
  • Add an assertion task (grep -q 'SystemdCgroup = true') that fails the play if the setting is absent, so a no-op can't pass again.
  • Verify the effective configuration with containerd config dump, since the NVIDIA toolkit later adds a drop-in file the main config doesn't show (see containerd Merges Drop-in Files Through imports, So config dump Shows the Real Config).
  • Add this failure pattern to the homelab repo's docs/troubleshooting.md.
  • Review the other playbooks for replace and lineinfile tasks whose goal is never asserted.

Lessons learned

  • ok means "nothing to do", not "done". A green recap shows that no task failed, not that the system reached the state the play exists for. For the settings that matter, end with a check that fails when they are missing.
  • Base conditions on content, not existence. "Does the file exist?" is a proxy. "Does the file contain what I need?" is the question.
  • Distribution packages differ from upstream defaults. Guides written against upstream binaries can assume a file layout that a distro package changes.
  • Read the boring lines. The clue was a skipped and an ok where changed was expected. Knowing what a first run should print is part of reading it.

References