Write mirror host location if mirror is in use

In various places we have wanted to have just the mirror host location
and not specific mirror config like for pip or apt or yum. For example
devstack-gate attempts to use this information to do simple networking
ping tests, dib tests construct yum repo locations on ubuntu and apt
repo locations on centos, and so on. Have a clear file that is set to
the root mirror location if a mirror is in use to make this simpler.

Change-Id: I306467f1870e5ee823b8b5c98d81917e607348ef
This commit is contained in:
Clark Boylan 2017-04-05 11:44:12 -07:00
parent d05bef0c12
commit 5151d13338
1 changed files with 6 additions and 0 deletions

View File

@ -299,3 +299,9 @@ elif [ "$LSBDISTID" == "Fedora" ]; then
sudo chown root:root /etc/yum.repos.d/*
sudo chmod 0644 /etc/yum.repos.d/*
fi
# Finally write the base mirror host location to /etc/nodepool/mirror_host
# This makes it easy for jobs to check if a mirror is expected at all
# in jobs and where it is located.
echo "$NODEPOOL_MIRROR_HOST" > /tmp/mirror_host
sudo mv /tmp/mirror_host /etc/nodepool/mirror_host