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:
| |
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:
| |
Implicit
Alternatively, there is also the linux-headers-generic package which automatically installs the relevant kernel version:
| |
In both cases, the package linux-headers-6.1.0-37-amd64 (at the time of writing) is installed on the system, as expected.
Not: This linux-headers-generic package can also easily be used without Ansible.