I try this
- name: Install required packages
shell: "apt-get instal linux-headers-{{ ansible_kernel }}"
However getting this instead
{"msg": "The task includes an option with an undefined variable. The error was: 'ansible_kernel' is undefined\
I can can see this variable via
ansible -i myinventoryfile myhost -m setup | grep kernel
and also
ansible -i myinventoryfile myhost -m shell -a "uname -r"
how can I get this working ?
Asked by hakkican
(99 rep)
Mar 28, 2018, 12:37 PM
Last activity: Jun 7, 2025, 12:20 AM
Last activity: Jun 7, 2025, 12:20 AM