Skip to content

Commit 9d3f806

Browse files
Enable vault repository for Rocky when mirrors don't work
This commit improves the Rocky9 vault repository usage. Instead of using `wget` from the URL of the vault, this commit enables vault repository, so all subsequent `yum` commands will be able to use the vault. This reduces code duplication and improves robustness. Example of repo configuration in Rocky: ``` cat /etc/yum.repos.d/Rocky-AppStream.repo # Rocky-AppStream.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically # close to the client. You should use this for Rocky updates unless you are # manually picking other mirrors. # # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. [appstream] name=Rocky Linux $releasever - AppStream mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 countme=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial ```
1 parent f848e1e commit 9d3f806

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,14 @@ phases:
206206
fi
207207
208208
if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then
209-
if [[ ${!OS} == "rocky8" ]] ; then
210-
REPOSITORY="BaseOS"
211-
else
212-
REPOSITORY="AppStream"
213-
fi
214209
for PACKAGE in ${!PACKAGE_LIST}
215210
do
216-
# try to install kernel source for a specific release version
217211
yum install -y ${!PACKAGE}
218212
if [ $? -ne 0 ]; then
219-
yum install -y wget
220-
# Previous releases are moved into a vault area once a new minor release version is available for at least a week.
221-
# https://wiki.rockylinux.org/rocky/repo/#notes-on-devel
222-
wget https://dl.rockylinux.org/vault/rocky/${!RELEASE_VERSION}/${!REPOSITORY}/$(uname -m)/os/Packages/k/${!PACKAGE}.rpm
223-
yum install -y ./${!PACKAGE}.rpm
213+
# Enable vault repository
214+
sed -i 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=http://dl.rockylinux.org/vault/rocky|g' /etc/yum.repos.d/*.repo
215+
sed -i 's|^#baseurl=https://dl.rockylinux.org/$contentdir|baseurl=https://dl.rockylinux.org/vault/rocky|g' /etc/yum.repos.d/*.repo
216+
yum install -y ${!PACKAGE}
224217
fi
225218
done
226219
else

0 commit comments

Comments
 (0)