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: ...