From f72f28869abe06cc70814493120d8ee97699be6b Mon Sep 17 00:00:00 2001 From: Ivan Shvedunov Date: Mon, 11 Jul 2016 16:46:09 +0300 Subject: [PATCH] Support custom Fedora repos in vagrant provider --- cluster/vagrant/provision-utils.sh | 9 ++++++++- cluster/vagrant/util.sh | 1 + docs/devel/developer-guides/vagrant.md | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cluster/vagrant/provision-utils.sh b/cluster/vagrant/provision-utils.sh index e75672d807e..3a90e1dc56a 100755 --- a/cluster/vagrant/provision-utils.sh +++ b/cluster/vagrant/provision-utils.sh @@ -28,7 +28,14 @@ function prepare-package-manager() { echo "Prepare package manager" # Useful if a mirror is broken or slow - echo "fastestmirror=True" >> /etc/dnf/dnf.conf + if [ -z "$CUSTOM_FEDORA_REPOSITORY_URL" ]; then + echo "fastestmirror=True" >> /etc/dnf/dnf.conf + else + # remove trailing slash from URL if it's present + CUSTOM_FEDORA_REPOSITORY_URL="${CUSTOM_FEDORA_REPOSITORY_URL%/}" + sed -i -e "/^metalink=/d" /etc/yum.repos.d/*.repo + sed -i -e "s@^#baseurl=http://download.fedoraproject.org/pub/fedora@baseurl=$CUSTOM_FEDORA_REPOSITORY_URL@" /etc/yum.repos.d/*.repo + fi } diff --git a/cluster/vagrant/util.sh b/cluster/vagrant/util.sh index d503e6c6dc8..536233ea34b 100755 --- a/cluster/vagrant/util.sh +++ b/cluster/vagrant/util.sh @@ -187,6 +187,7 @@ function echo-kube-env() { echo "OPENCONTRAIL_KUBERNETES_TAG='${OPENCONTRAIL_KUBERNETES_TAG:-}'" echo "OPENCONTRAIL_PUBLIC_SUBNET='${OPENCONTRAIL_PUBLIC_SUBNET:-}'" echo "E2E_STORAGE_TEST_ENVIRONMENT='${E2E_STORAGE_TEST_ENVIRONMENT:-}'" + echo "CUSTOM_FEDORA_REPOSITORY_URL='${CUSTOM_FEDORA_REPOSITORY_URL:-}'" } function verify-cluster { diff --git a/docs/devel/developer-guides/vagrant.md b/docs/devel/developer-guides/vagrant.md index ff6b98f2163..fa8bb48e1b3 100644 --- a/docs/devel/developer-guides/vagrant.md +++ b/docs/devel/developer-guides/vagrant.md @@ -429,6 +429,20 @@ environment variables. For example, if running `make quick-release`, use: sudo -E make quick-release ``` +#### I have repository access errors during VM provisioning! + +Sometimes VM provisioning may fail with errors that look like this: + +``` +Timeout was reached for https://mirrors.fedoraproject.org/metalink?repo=fedora-23&arch=x86_64 [Connection timed out after 120002 milliseconds] +``` + +You may use a custom Fedora repository URL to fix this: + +```shell +export CUSTOM_FEDORA_REPOSITORY_URL=https://download.fedoraproject.org/pub/fedora/ +``` + #### I ran vagrant suspend and nothing works! `vagrant suspend` seems to mess up the network. It's not supported at this time.