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 9868f5179..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 @@ -25,7 +25,6 @@ bash "Install kernel source" do user 'root' code <<-INSTALL_KERNEL_SOURCE - set -e package="#{kernel_source_package}-#{kernel_source_package_version}" # try to install kernel source for a specific release version @@ -33,14 +32,18 @@ if [ $? -ne 0 ]; then # 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 - wget https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/$(uname -m)/os/Packages/k/${package}.rpm - dnf install -y ./${package}.rpm + set -e + 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