Skip to content

Commit

Permalink
Merge pull request #12710 from Xeicker/kernel_uek_ol
Browse files Browse the repository at this point in the history
Add kernel-uek for OL in system_with_kernel CPE
  • Loading branch information
Mab879 authored Dec 13, 2024
2 parents 933633d + 6f45a27 commit 5574a66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shared/applicability/oval/system_with_kernel.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<def-group>
<definition class="inventory" id="system_with_kernel" version="1">
{{{ oval_metadata("The kernel is installed", affected_platforms=["multi_platform_all"]) }}}
<criteria operator="AND">
<criteria operator="OR">
<criterion comment="kernel is installed" test_ref="inventory_test_kernel_installed" />
{{% if "ol" in families %}}
<criterion comment="kernel-uek is installed" test_ref="inventory_test_kernel_uek_installed" />
{{% endif %}}
</criteria>
</definition>
{{% if 'debian' in product or 'ubuntu' in product %}}
Expand All @@ -12,4 +15,7 @@
{{% else %}}
{{{ oval_test_package_installed(package="kernel", test_id="inventory_test_kernel_installed") }}}
{{% endif %}}
{{% if "ol" in families %}}
{{{ oval_test_package_installed(package="kernel-uek", test_id="inventory_test_kernel_uek_installed") }}}
{{% endif %}}
</def-group>
4 changes: 4 additions & 0 deletions shared/applicability/system_with_kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ check_id: system_with_kernel
{{% if pkg_system == "rpm" %}}
{{% if "sle" in product or "slmicro" in product %}}
bash_conditional: "rpm --quiet -q kernel-default"
{{% elif "ol" in families %}}
bash_conditional: "rpm --quiet -q kernel || rpm --quiet -q kernel-uek"
{{% else %}}
bash_conditional: "rpm --quiet -q kernel"
{{% endif %}}
Expand All @@ -32,6 +34,8 @@ bash_conditional: "dpkg-query --show --showformat='${db:Status-Status}\n' 'kerne
ansible_conditional: '"linux-base" in ansible_facts.packages'
{{% elif "sle" in product or "slmicro" in product %}}
ansible_conditional: '"kernel-default" in ansible_facts.packages'
{{% elif "ol" in families %}}
ansible_conditional: '("kernel" in ansible_facts.packages or "kernel-uek" in ansible_facts.packages)'
{{% else %}}
ansible_conditional: '"kernel" in ansible_facts.packages'
{{% endif %}}

0 comments on commit 5574a66

Please sign in to comment.