summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorParide Legovini <paride.legovini@canonical.com>2021-07-13 21:23:19 +0200
committerGitHub <noreply@github.com>2021-07-13 13:23:19 -0600
commit881be6e780b258e98d1ecba4777ba3e171d5760d (patch)
tree2d0fab5ed4063c3bb045b701fefa2adf4e0a5885 /tools
parenta185f31911dfc58662eb1eb5d39a9ab3ed178ff5 (diff)
downloadvyos-cloud-init-881be6e780b258e98d1ecba4777ba3e171d5760d.tar.gz
vyos-cloud-init-881be6e780b258e98d1ecba4777ba3e171d5760d.zip
run-container: fixup the centos repos baseurls when using http_proxy (#944)
The EPEL repo file used to have download.fedoraproject.org as its baseurl. That has now been replaced by `download.example`, which we need to replace with dl.fedoraproject.org, the actual mirror we want to download from. We can't use download.fedoraproject.org or the mirrorlist (which is the default way for finding mirrors) because of our internal proxy rules. This change only applies if http_proxy is set, otherwise the mirrors are reached in the default way.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/read-dependencies1
-rwxr-xr-xtools/run-container1
2 files changed, 2 insertions, 0 deletions
diff --git a/tools/read-dependencies b/tools/read-dependencies
index a2577e87..e52720d4 100755
--- a/tools/read-dependencies
+++ b/tools/read-dependencies
@@ -40,6 +40,7 @@ MAYBE_RELIABLE_YUM_INSTALL = [
error ":: http proxy in use => forcing the use of fixed URLs in /etc/yum.repos.d/*.repo"
sed -i --regexp-extended '/^#baseurl=/s/#// ; /^(mirrorlist|metalink)=/s/^/#/' /etc/yum.repos.d/*.repo
sed -i 's/download\.fedoraproject\.org/dl.fedoraproject.org/g' /etc/yum.repos.d/*.repo
+ sed -i 's/download\.example/dl.fedoraproject.org/g' /etc/yum.repos.d/*.repo
}
configure_repos_for_proxy_use
n=0; max=10;
diff --git a/tools/run-container b/tools/run-container
index 1bd10971..e049dfdc 100755
--- a/tools/run-container
+++ b/tools/run-container
@@ -353,6 +353,7 @@ wait_for_boot() {
inside "$name" sh -c "echo proxy=$http_proxy >> /etc/yum.conf"
inside "$name" sh -c "sed -i --regexp-extended '/^#baseurl=/s/#// ; /^(mirrorlist|metalink)=/s/^/#/' /etc/yum.repos.d/*.repo"
inside "$name" sh -c "sed -i 's/download\.fedoraproject\.org/dl.fedoraproject.org/g' /etc/yum.repos.d/*.repo"
+ inside "$name" sh -c "sed -i 's/download\.example/dl.fedoraproject.org/g' /etc/yum.repos.d/*.repo"
else
debug 1 "do not know how to configure proxy on $OS_NAME"
fi