From 09c6d60c0345e47fa42c92fd5071a6ff7f987375 Mon Sep 17 00:00:00 2001 From: Himani Anil Deshpande <79726937+himani2411@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:55:15 -0400 Subject: [PATCH] Installing packages from BaseOS and AppStream if available (#2740) Co-authored-by: Himani Deshpande --- .../install_packages/install_packages_rocky8.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 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 20539b861..36c50e800 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 @@ -32,8 +32,16 @@ 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 + base_os_package_url="https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm" + appstream_package_url="https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/AppStream/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm" + base_os_status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null ${base_os_package_url}) + appstream_status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null ${appstream_package_url}) set -e - dnf install -y https://dl.rockylinux.org/vault/rocky/#{node['platform_version']}/BaseOS/#{node['kernel']['machine']}/os/Packages/k/${package}.rpm + if [ $base_os_status_code != 404 ]; then + dnf install -y ${base_os_package_url} + elif [ $appstream_status_code != 404 ]; then + dnf install -y ${appstream_package_url} + fi fi dnf clean all INSTALL_KERNEL_SOURCE