From 6a74396d3db7bddd4c818dfe172c559d68eb0240 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 14 Dec 2023 12:48:05 +0100 Subject: [PATCH] Avoid to exit while trying to install a specific kernel-devel version This code has been created to try to install using `--releasever` parameter and if this command fails try to install the package from vault, anyway the `set -e` at the top of the failing was causing all the build to fail. Manually tested in a Rocky-8-EC2-Base-8.8-20230518.0.x86_64 Related to: https://github.com/aws/aws-parallelcluster-cookbook/pull/2598 Signed-off-by: Enrico Usai --- .../resources/install_packages/install_packages_rocky8.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..6602e9bc4 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,6 +32,7 @@ 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 + 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 fi