Installing the correct linux-headers package with Ansible

On a Debian system, it sometimes makes sense to have the linux-headers-${version} package installed, where ${version} is the kernel version. On command line, the proposal is to run: 1 apt install linux-headers-$(uname -r) which is hard to do when installing things with Ansible. Now there’s two ways around this issue: Explicit As it turns out, Ansible stores the kernel version in the ansible_kernel version. With that, I can do the following: ...

November 18, 2025 · 1 min · 147 words · Chris Pratl

Create a UUID in Ansible

Today I learned how to generate a UUID in Ansible. I would like to write that down so that I can look that up again next time I need it.

November 7, 2023 · 1 min · 136 words · Chris Pratl