From 8d2bb6d9c47280d2ecd3593b4caff2415fb1d59c Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 14 Dec 2023 14:12:49 +0100 Subject: [PATCH] Fix kernel-devel package name for rhel8 When using `wget`, the package name must contain the architecture too. By redefining the `kernel_source_package_version` we're avoiding to `chomp` the architecture from kernel version. Then, use `node['kernel']['machine']` rather than `uname -m`. ### Tests Verified that both `dnf install` and `wget` commands are working when passing architecture. ### References * https://github.com/chef/ohai/blob/17-stable/lib/ohai/plugins/kernel.rb#L34 Signed-off-by: Enrico Usai --- .../resources/install_packages/install_packages_rocky8.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb index 6602e9bc4..a2cbf87a2 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb @@ -33,14 +33,17 @@ # Previous releases are moved into a vault area once a new minor release version is available for at least a week. # https://wiki.rockylinux.org/rocky/repo/#notes-on-devel set -e - wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm - dnf install -y ./${package}.rpm + dnf install -y https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm fi dnf clean all INSTALL_KERNEL_SOURCE end unless on_docker? end +def kernel_source_package_version + node['kernel']['release'] +end + def default_packages # environment-modules required by EFA, Intel MPI and ARM PL # iptables needed for IMDS setup