summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-04-25 01:13:55 +0200
committerAhmed Abdelhalim <[email protected]>2026-04-25 01:13:55 +0200
commit43713d18273da0ec550f28bf697903dc6cec72cc (patch)
tree7732ae1f8b320a4848e9694904f7f040290c9460
parentb7095cb5da0ce3381c2b2e4f8681df200ad1b16c (diff)
Fix linux headers role on different OSs
-rw-r--r--roles/linux_headers/tasks/main.yml5
-rw-r--r--roles/linux_headers/vars/archlinux.yml2
-rw-r--r--roles/linux_headers/vars/debian.yml2
3 files changed, 8 insertions, 1 deletions
diff --git a/roles/linux_headers/tasks/main.yml b/roles/linux_headers/tasks/main.yml
index 454e4af8..76b23e8b 100644
--- a/roles/linux_headers/tasks/main.yml
+++ b/roles/linux_headers/tasks/main.yml
@@ -1,6 +1,9 @@
---
+- name: "Include OS-specific variables"
+ ansible.builtin.include_vars: "{{ ansible_facts['os_family'] | lower }}.yml"
+
- name: "Ensure linux-headers is installed"
become: true
ansible.builtin.package:
- name: "linux-headers"
+ name: "{{ linux_headers_pkg }}"
state: "present"
diff --git a/roles/linux_headers/vars/archlinux.yml b/roles/linux_headers/vars/archlinux.yml
new file mode 100644
index 00000000..227fbb17
--- /dev/null
+++ b/roles/linux_headers/vars/archlinux.yml
@@ -0,0 +1,2 @@
+---
+linux_headers_pkg: "linux-headers"
diff --git a/roles/linux_headers/vars/debian.yml b/roles/linux_headers/vars/debian.yml
new file mode 100644
index 00000000..d3e3e625
--- /dev/null
+++ b/roles/linux_headers/vars/debian.yml
@@ -0,0 +1,2 @@
+---
+linux_headers_pkg: "linux-headers-{{ ansible_kernel }}"