Refactor configure_facts.sh
This refactors the script based on the following points. - Remove unused environment - Select facts according to distribution - Create temporal .repo file only in CentOS - Create a centralized option to control OpenStack release Change-Id: I34829b4d9737eda16e1c08863ce9ebb74f402b8d
This commit is contained in:
parent
d60a2281c3
commit
8f2bced9a0
@ -18,10 +18,12 @@ export OS_NAME_VERS=${ID}${VERSION_ID}
|
|||||||
|
|
||||||
# Write out facts to the facter folder when we generate them.
|
# Write out facts to the facter folder when we generate them.
|
||||||
export WRITE_FACTS=${WRITE_FACTS:-true}
|
export WRITE_FACTS=${WRITE_FACTS:-true}
|
||||||
export DLRN_BASE=${DLRN_BASE:-${OS_NAME_VERS}-master/puppet-passed-ci}
|
export OPENSTACK_VERSION=${OPENSTACK_VERSION:-master}
|
||||||
export DLRN_DEPS_BASE=${DLRN_DEPS_BASE:-${OS_NAME_VERS}-master/deps/latest/}
|
export DLRN_TAG=${DLRN_TAG:-puppet-passed-ci}
|
||||||
export DLRN_BASE_URL=${DLRN_BASE_URL:-${OS_NAME_VERS}-master/puppet-passed-ci/delorean.repo}
|
export DLRN_ROOT=${DLRN_ROOT:-${OS_NAME_VERS}-${OPENSTACK_VERSION}}
|
||||||
export DLRN_DEPS_URL=${DLRN_DEPS_URL:-${OS_NAME_VERS}-master/delorean-deps.repo}
|
export DLRN_BASE=${DLRN_BASE:-${DLRN_ROOT}/${DLRN_TAG}}
|
||||||
|
export DLRN_BASE_URL=${DLRN_BASE_URL:-${DLRN_BASE}/delorean.repo}
|
||||||
|
export DLRN_DEPS_URL=${DLRN_DEPS_URL:-${DLRN_ROOT}/delorean-deps.repo}
|
||||||
export CEPH_VERSION=${CEPH_VERSION:-reef}
|
export CEPH_VERSION=${CEPH_VERSION:-reef}
|
||||||
|
|
||||||
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
|
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
|
||||||
@ -31,7 +33,6 @@ if [ -f /etc/ci/mirror_info.sh ]; then
|
|||||||
source /etc/ci/mirror_info.sh
|
source /etc/ci/mirror_info.sh
|
||||||
|
|
||||||
CENTOS_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}/centos-stream"
|
CENTOS_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}/centos-stream"
|
||||||
DEPS_MIRROR_HOST="${NODEPOOL_RDO_PROXY}/${DLRN_DEPS_BASE}/"
|
|
||||||
if uses_debs; then
|
if uses_debs; then
|
||||||
CEPH_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}/ceph-deb-${CEPH_VERSION}"
|
CEPH_MIRROR_HOST="http://${NODEPOOL_MIRROR_HOST}/ceph-deb-${CEPH_VERSION}"
|
||||||
NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/apt-puppetlabs"
|
NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/apt-puppetlabs"
|
||||||
@ -41,7 +42,6 @@ if [ -f /etc/ci/mirror_info.sh ]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
CENTOS_MIRROR_HOST='http://mirror.stream.centos.org'
|
CENTOS_MIRROR_HOST='http://mirror.stream.centos.org'
|
||||||
DEPS_MIRROR_HOST="https://trunk.rdoproject.org/${DLRN_DEPS_BASE}/"
|
|
||||||
NODEPOOL_RDO_PROXY='https://trunk.rdoproject.org'
|
NODEPOOL_RDO_PROXY='https://trunk.rdoproject.org'
|
||||||
NODEPOOL_UCA_MIRROR='http://ubuntu-cloud.archive.canonical.com/ubuntu'
|
NODEPOOL_UCA_MIRROR='http://ubuntu-cloud.archive.canonical.com/ubuntu'
|
||||||
if uses_debs; then
|
if uses_debs; then
|
||||||
@ -53,31 +53,29 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -o /tmp/delorean.repo "${NODEPOOL_RDO_PROXY}/${OS_NAME_VERS}-master/puppet-passed-ci/delorean.repo"
|
if uses_debs; then
|
||||||
sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean.repo
|
MIRROR_FACTS="\
|
||||||
curl -o /tmp/delorean-deps.repo "${NODEPOOL_RDO_PROXY}/${OS_NAME_VERS}-master/delorean-deps.repo"
|
openstack_version=${OPENSTACK_VERSION}
|
||||||
sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean-deps.repo
|
uca_mirror_host=${UCA_MIRROR_HOST}
|
||||||
sed -i -e "s|http://mirror.centos.org|${CENTOS_MIRROR_HOST}|g" /tmp/delorean-deps.repo
|
ceph_mirror_host=${CEPH_MIRROR_HOST}
|
||||||
sed -i -e "s|http://mirror.stream.centos.org|${CENTOS_MIRROR_HOST}|g" /tmp/delorean-deps.repo
|
ceph_version=${CEPH_VERSION}"
|
||||||
|
else
|
||||||
|
curl -o /tmp/delorean.repo "${NODEPOOL_RDO_PROXY}/${DLRN_BASE_URL}"
|
||||||
|
sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean.repo
|
||||||
|
|
||||||
export FACTER_nodepool_mirror_host=$NODEPOOL_MIRROR_HOST
|
curl -o /tmp/delorean-deps.repo "${NODEPOOL_RDO_PROXY}/${DLRN_DEPS_URL}"
|
||||||
export FACTER_centos_mirror_host=$CENTOS_MIRROR_HOST
|
sed -i -e "s|https://trunk.rdoproject.org|${NODEPOOL_RDO_PROXY}|g" /tmp/delorean-deps.repo
|
||||||
export FACTER_uca_mirror_host=$NODEPOOL_UCA_MIRROR
|
sed -i -e "s|http://mirror.centos.org|${CENTOS_MIRROR_HOST}|g" /tmp/delorean-deps.repo
|
||||||
export FACTER_deps_mirror_host=$DEPS_MIRROR_HOST
|
sed -i -e "s|http://mirror.stream.centos.org|${CENTOS_MIRROR_HOST}|g" /tmp/delorean-deps.repo
|
||||||
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="\
|
MIRROR_FACTS="\
|
||||||
nodepool_mirror_host=${FACTER_nodepool_mirror_host}
|
openstack_version=${OPENSTACK_VERSION}
|
||||||
centos_mirror_host=${FACTER_centos_mirror_host}
|
centos_mirror_host=${CENTOS_MIRROR_HOST}
|
||||||
uca_mirror_host=${FACTER_uca_mirror_host}
|
ceph_mirror_host=${CEPH_MIRROR_HOST}
|
||||||
deps_mirror_host=${FACTER_deps_mirror_host}
|
ceph_version=${CEPH_VERSION}
|
||||||
ceph_mirror_host=${FACTER_ceph_mirror_host}
|
delorean_repo_path=/tmp/delorean.repo
|
||||||
ceph_version=${FACTER_ceph_version}
|
delorean_deps_repo_path=/tmp/delorean-deps.repo"
|
||||||
delorean_repo_path=${FACTER_delorean_repo_path}
|
fi
|
||||||
delorean_deps_repo_path=${FACTER_delorean_deps_repo_path}"
|
|
||||||
|
|
||||||
if [ "${WRITE_FACTS}" = true ]; then
|
if [ "${WRITE_FACTS}" = true ]; then
|
||||||
$SUDO mkdir -p /etc/facter/facts.d/
|
$SUDO mkdir -p /etc/facter/facts.d/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user