summaryrefslogtreecommitdiff
path: root/tools/run-container
diff options
context:
space:
mode:
authorParide Legovini <paride.legovini@canonical.com>2019-01-25 17:52:41 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-01-25 17:52:41 +0000
commit7a4696596bbcccfedf5c6b6e25ad684ef30d9cea (patch)
tree6ae8a7d5739aab8e51647c1384624d40c5c9ffd5 /tools/run-container
parentc283321bb118d5408390e12b173440f57bd2c160 (diff)
downloadvyos-cloud-init-7a4696596bbcccfedf5c6b6e25ad684ef30d9cea.tar.gz
vyos-cloud-init-7a4696596bbcccfedf5c6b6e25ad684ef30d9cea.zip
run-container: uncomment baseurl in yum.repos.d/*.repo when using a proxy
When using a proxy it is often useful to know in advance which mirrors are to be contacted, so a whitelist can be set up. This is not easy when using the yum.conf(5) mirrorlist option, as the retrieved list of mirrors may change. The repository definition may also specify a canonical mirror with the 'baseurl' option; this option is often commented out by default to favor the usage of worldwide mirrors. This patch uncomments 'baseurl' when an http_proxy is being used, so the canonical mirror is used *in addition to* the mirrors retrieved from the mirrorlist.
Diffstat (limited to 'tools/run-container')
-rwxr-xr-xtools/run-container1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/run-container b/tools/run-container
index 6dedb757..852f4d1e 100755
--- a/tools/run-container
+++ b/tools/run-container
@@ -373,6 +373,7 @@ wait_for_boot() {
inside "$name" sh -c "echo proxy=$http_proxy >> /etc/yum.conf"
inside "$name" sed -i s/enabled=1/enabled=0/ \
/etc/yum/pluginconf.d/fastestmirror.conf
+ inside "$name" sh -c "sed -i '/^#baseurl=/s/#//' /etc/yum.repos.d/*.repo"
else
debug 1 "do not know how to configure proxy on $OS_NAME"
fi