Files
puppet-openstack-integration/configure_facts.sh
Takashi Kajinami 73fc9c7cff Ceph: Use centos-8-stream instead of centos-8
Conflicts:
	configure_facts.sh
	manifests/repos.pp

Backport note:
This backport includes part of f384effdb4
which fixed the repository url used when mirror info is not available.

Also, this adds a puppet-openstack_extras parameter to enforce usage of
stream repo. Default was changed during Xena cycle by [1] but that
is not present in stable/wallaby and older.
  [1] cf8b734766bbe75ac5ce23d7a4237b77c8200dd3

In addition, this bumps Ceph used in Puppet 5 integration job in
CentOS 8 from luminous to nautilus, because luminous is quite old and
no longer hosted in mirror.

Finally, Nautilus is not available in ceph mirror so we'll switch to
the mirror repo currently RDO is hosting.

Depends-on: https://review.opendev.org/827853

Change-Id: I97995b6821a24b64edbc5b1e874ba67a0418f96a
(cherry picked from commit b2fa6c0e7b)
(cherry picked from commit 8c00b663d3)
(cherry picked from commit 4d6a35effa)
(cherry picked from commit 0a9eec11e0)
2022-02-04 23:49:45 +09:00

106 lines
4.9 KiB
Bash

#!/bin/bash -ex
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
source /etc/os-release
OS_NAME_VERS=${ID}${VERSION_ID}
# Write out facts to the facter folder when we generate them.
export WRITE_FACTS=${WRITE_FACTS:-true}
export DLRN_BASE=${DLRN_BASE:-${OS_NAME_VERS}-ussuri/current-passed-ci/}
export DLRN_DEPS_BASE=${DLRN_DEPS_BASE:-${OS_NAME_VERS}-ussuri/deps/latest/}
export DLRN_BASE_URL=${DLRN_BASE_URL:-${OS_NAME_VERS}-ussuri/current-passed-ci/delorean.repo}
export DLRN_DEPS_URL=${DLRN_DEPS_URL:-${OS_NAME_VERS}-ussuri/delorean-deps.repo}
export CEPH_VERSION=${CEPH_VERSION:-nautilus}
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}"
DEPS_MIRROR_HOST="${NODEPOOL_RDO_PROXY}/${DLRN_DEPS_BASE}/"
if uses_debs; then
if [ "$CEPH_VERSION" == "mimic" ] || [ "CEPH_VERSION" == "luminous" ] ; then
CEPH_MIRROR_HOST="http://download.ceph.com/debian-${CEPH_VERSION}"
else
CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/ceph-deb-${CEPH_VERSION}"
fi
NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/apt-puppetlabs"
else
# NOTE(tobias-urdin): Mimic was never released by Storage SIG to official mirros.
if [ "$CEPH_VERSION" == "mimic" ]; then
CEPH_MIRROR_HOST="https://trunk.rdoproject.org/centos${VERSION_ID}/deps/storage/storage${VERSION_ID}-ceph-mimic/x86_64/"
elif [ "$CEPH_VERSION" == "nautilus" ]; then
CEPH_MIRROR_HOST="${NODEPOOL_RDO_PROXY}/centos${VERSION_ID}-master/deps/storage/${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'
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'
if uses_debs; then
CEPH_MIRROR_HOST="https://download.ceph.com/debian-${CEPH_VERSION}"
NODEPOOL_PUPPETLABS_MIRROR='https://apt.puppetlabs.com'
else
# NOTE(tobias-urdin): Mimic was never released by Storage SIG to official mirros.
if [ "$CEPH_VERSION" == "mimic" ]; then
CEPH_MIRROR_HOST="https://trunk.rdoproject.org/centos${VERSION_ID}/deps/storage/storage${VERSION_ID}-ceph-mimic/x86_64/"
elif [ "$CEPH_VERSION" == "nautilus" ]; then
CEPH_MIRROR_HOST="${NODEPOOL_RDO_PROXY}/centos${VERSION_ID}-master/deps/storage/${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
curl -o /tmp/delorean.repo "${NODEPOOL_RDO_PROXY}/centos8-ussuri/current-passed-ci/delorean.repo"
sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean.repo
curl -o /tmp/delorean-deps.repo "${NODEPOOL_RDO_PROXY}/centos8-ussuri/delorean-deps.repo"
sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean-deps.repo
export FACTER_nodepool_mirror_host=$NODEPOOL_MIRROR_HOST
export FACTER_centos_mirror_host=$CENTOS_MIRROR_HOST
export FACTER_uca_mirror_host=$NODEPOOL_UCA_MIRROR
export FACTER_deps_mirror_host=$DEPS_MIRROR_HOST
export FACTER_ceph_mirror_host=$CEPH_MIRROR_HOST
export FACTER_ceph_version=$CEPH_VERSION
export FACTER_delorean_repo_path="/tmp/delorean.repo"
export FACTER_delorean_deps_repo_path="/tmp/delorean-deps.repo"
MIRROR_FACTS="\
nodepool_mirror_host=${FACTER_nodepool_mirror_host}
centos_mirror_host=${FACTER_centos_mirror_host}
uca_mirror_host=${FACTER_uca_mirror_host}
deps_mirror_host=${FACTER_deps_mirror_host}
ceph_mirror_host=${FACTER_ceph_mirror_host}
ceph_version=${FACTER_ceph_version}
delorean_repo_path=${FACTER_delorean_repo_path}
delorean_deps_repo_path=${FACTER_delorean_deps_repo_path}"
if [ "${WRITE_FACTS}" = true ]; then
$SUDO mkdir -p /etc/facter/facts.d/
echo "$MIRROR_FACTS" | $SUDO tee /etc/facter/facts.d/mirrors.txt
fi