Skip to content

Commit

Permalink
Merge pull request #14 from sysdiglabs/reduce_el_kernel_devel_complexity
Browse files Browse the repository at this point in the history
fix: reduce complexities of kernel devel detections for EL distros
  • Loading branch information
aroberts87 authored May 12, 2023
2 parents 927a019 + 3578fb9 commit 30a84ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
- name: (AlmaLinux) Install Kernel Headers (8)
ansible.builtin.dnf:
name: "{{ kernel_header_package }}"
name: "kernel-devel-{{ ansible_kernel }}"
state: present
vars:
- match_str: uek
kernel_header_package: kernel-uek-devel-{{ ansible_kernel }}
- match_str: .*
kernel_header_package: kernel-devel-{{ ansible_kernel }}
when:
- ansible_kernel_version | regex_search(.match_str)
- ansible_distribution_major_version == "8"
when: ansible_distribution_major_version == "8"

- name: (AlmaLinux) Install Kernel Headers (9)
ansible.builtin.dnf:
Expand Down
13 changes: 2 additions & 11 deletions tasks/agent/dependencies/centos/install-centos-dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
- name: (CentOS) Install Kernel Headers (7/8)
ansible.builtin.yum:
name: "{{ kernel_devel_package }}"
name: "kernel-devel-{{ ansible_kernel }}"
state: present
vars:
- match_str: vzkernel
kernel_devel_package: vzkernel-devel
- match_str: uek
kernel_devel_package: kernel-uek-devel-{{ ansible_kernel }}
- match_str: .*
kernel_devel_package: kernel-devel-{{ ansible_kernel }}
when:
- ansible_kernel_version | regex_search(match_str)
- ansible_distribution_major_version in ["7", "8"]
when: ansible_distribution_major_version in ["7", "8"]

- name: (CentOS) Install Kernel Headers (9)
ansible.builtin.dnf:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
- name: (RockyLinux) Install Kernel Headers (8)
ansible.builtin.dnf:
name: "{{ kernel_header_package }}"
name: "kernel-devel-{{ ansible_kernel }}"
state: present
vars:
- match_str: uek
kernel_header_package: kernel-uek-devel-{{ ansible_kernel }}
- match_str: .*
kernel_header_package: kernel-devel-{{ ansible_kernel }}
when:
- ansible_kernel_version | regex_search(match_str)
- ansible_distribution_major_version == "8"
when: ansible_distribution_major_version == "8"

- name: (RockyLinux) Install Kernel Headers (9)
ansible.builtin.dnf:
Expand Down

0 comments on commit 30a84ae

Please sign in to comment.