Use external centos7-rt if present

Depending on the environment we execute this we need different
configuration for the centos7-rt repo, like at RDO zuul ci we have to
use nodepool mirrors, this patch check for a centos7-rt repo and enables
it if it's not present just creates a default one

Change-Id: I630a399d95752b1fb1e30220a582ace8d7b97f18
Related-Bug: #1814872
This commit is contained in:
Quique Llorente 2019-02-06 12:38:42 +01:00
parent 53f4899ce4
commit d313a060c8

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
@ -7,6 +7,8 @@ set -eu
set -o pipefail
if [[ "$DISTRO_NAME" == *"centos"* ]]; then
current_rt_repo=$(yum repolist all|grep "centos7-rt" |awk '{print $1}'| head -n 1 || true)
if [[ "$current_rt_repo" == "" ]]; then
cat << EOF > /etc/yum.repos.d/centos7-rt.repo
[centos7-rt]
name=CentOS 7 - Realtime
@ -14,4 +16,7 @@ baseurl=http://mirror.centos.org/centos/7/rt/x86_64/
enabled=1
gpgcheck=0
EOF
else
yum-config-manager --enable $current_rt_repo
fi
fi