From 55232a87c1dc338b937f51a63458e79918d65679 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 7 Jun 2022 23:28:52 +0900 Subject: [PATCH] CentOS 9: Fix Ceph mirror url Ceph packages for CentOS 9 are already available in mirror but these are placed in a slightly different url. This change updates the repository url used in integration jobs and litmus jobs. Change-Id: I7a1ab46523698e97d3329998de66729f113f166d --- configure_facts.sh | 29 +++++++++++++++++++---------- manifests/repos.pp | 15 ++++++++++++--- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/configure_facts.sh b/configure_facts.sh index 60a6c9a7c..c5980f157 100644 --- a/configure_facts.sh +++ b/configure_facts.sh @@ -27,29 +27,33 @@ export CEPH_VERSION=${CEPH_VERSION:-pacific} export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) source $SCRIPT_DIR/functions -if [ -f /etc/fedora-release ]; then - DLRN_BASE="fedora/puppet-passed-ci" - DLRN_DEPS_BASE="fedora/stable-base/latest/" -fi - if [ -f /etc/ci/mirror_info.sh ]; then source /etc/ci/mirror_info.sh - CENTOS_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}" + + if [ "${OS_NAME_VERS}" == "centos9" ]; then + CENTOS_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}/centos-stream" + else + CENTOS_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}" + fi + DEPS_MIRROR_HOST="${NODEPOOL_RDO_PROXY}/${DLRN_DEPS_BASE}/" if uses_debs; then CEPH_MIRROR_HOST="http://download.ceph.com/debian-${CEPH_VERSION}" NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/apt-puppetlabs" else - # TODO centos9 content is still not mirrored if [ "${OS_NAME_VERS}" == "centos9" ]; then - CEPH_MIRROR_HOST="https://buildlogs.centos.org/centos/9-stream/storage/x86_64/ceph-${CEPH_VERSION}/" + CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/SIGs/${VERSION_ID}-stream/storage/x86_64/ceph-${CEPH_VERSION}/" else CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${VERSION_ID}-stream/storage/x86_64/ceph-${CEPH_VERSION}/" fi NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/yum-puppetlabs" fi else - CENTOS_MIRROR_HOST='http://mirror.centos.org' + if [ "${OS_NAME_VERS}" == "centos9" ]; then + CENTOS_MIRROR_HOST='http://mirror.stream.centos.org' + else + CENTOS_MIRROR_HOST='http://mirror.centos.org' + fi DEPS_MIRROR_HOST="https://trunk.rdoproject.org/${DLRN_DEPS_BASE}/" NODEPOOL_RDO_PROXY='https://trunk.rdoproject.org' NODEPOOL_UCA_MIRROR='http://ubuntu-cloud.archive.canonical.com/ubuntu' @@ -57,7 +61,11 @@ else CEPH_MIRROR_HOST="https://download.ceph.com/debian-${CEPH_VERSION}" NODEPOOL_PUPPETLABS_MIRROR='https://apt.puppetlabs.com' else - CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${VERSION_ID}-stream/storage/x86_64/ceph-${CEPH_VERSION}/" + if [ "${OS_NAME_VERS}" == "centos9" ]; then + CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/SIGs/${VERSION_ID}-stream/storage/x86_64/ceph-${CEPH_VERSION}/" + else + CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${VERSION_ID}-stream/storage/x86_64/ceph-${CEPH_VERSION}/" + fi NODEPOOL_PUPPETLABS_MIRROR="https://yum.puppetlabs.com" fi fi @@ -67,6 +75,7 @@ sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean curl -o /tmp/delorean-deps.repo "${NODEPOOL_RDO_PROXY}/${OS_NAME_VERS}-master/delorean-deps.repo" sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean-deps.repo sed -i -e "s|http://mirror.centos.org|${CENTOS_MIRROR_HOST}|g" /tmp/delorean-deps.repo +sed -i -e "s|http://mirror.stream.centos.org|${CENTOS_MIRROR_HOST}|g" /tmp/delorean-deps.repo export FACTER_nodepool_mirror_host=$NODEPOOL_MIRROR_HOST export FACTER_centos_mirror_host=$CENTOS_MIRROR_HOST diff --git a/manifests/repos.pp b/manifests/repos.pp index cc9889de9..0d8f0e4b6 100644 --- a/manifests/repos.pp +++ b/manifests/repos.pp @@ -48,15 +48,19 @@ class openstack_integration::repos { } 'RedHat': { # Set specific variables for CentOS Stream 9 - if $::os['release']['major'] >= '9' { + if versioncmp($::os['release']['major'], '9') >= 0 { $powertools_repo = 'crb' } else { $powertools_repo = 'powertools' } + if defined('$::centos_mirror_host') and $::centos_mirror_host != '' { $centos_mirror = $::centos_mirror_host } else { - $centos_mirror = 'http://mirror.centos.org' + $centos_mirror = $::os['release']['major'] ? { + '9' => 'http://mirror.stream.centos.org', + default => 'http://mirror.centos.org', + } } if defined('$::delorean_repo_path') and $::delorean_repo_path != '' { @@ -82,7 +86,12 @@ class openstack_integration::repos { repo_replace => false, update_packages => true, } - $ceph_mirror_fallback = "${centos_mirror}/centos/${::os['release']['major']}-stream/storage/x86_64/ceph-${ceph_version_real}/" + + $ceph_mirror_fallback = $::os['release']['major'] ? { + '9' => "${centos_mirror}/SIGs/${::os['release']['major']}-stream/storage/x86_64/ceph-${ceph_version_real}/", + default => "${centos_mirror}/centos/${::os['release']['major']}-stream/storage/x86_64/ceph-${ceph_version_real}/", + } + if defined('$::ceph_mirror_host') and $::ceph_mirror_host != '' { $ceph_mirror = pick($::ceph_mirror_host, $ceph_mirror_fallback) } else {