aboutsummaryrefslogtreecommitdiff
path: root/dev/vagrant/bootstrap.sh
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2016-04-26 17:16:27 +0100
committerPaul Bourke <paul.bourke@oracle.com>2016-05-18 10:56:44 +0100
commitd2a62c96cdbb12b2811e5d04e70adaadbd0cd350 (patch)
treef8bee3f5abaf419f87f164f585b67cc69131d1e3 /dev/vagrant/bootstrap.sh
parentcb8e3b605eff14893636092b4b3c99c1eda4f82e (diff)
downloadkolla-d2a62c96cdbb12b2811e5d04e70adaadbd0cd350.tar.gz
kolla-d2a62c96cdbb12b2811e5d04e70adaadbd0cd350.zip
Improve Vagrants bootstrap.sh proxy support
* sudo is not needed as script already runs as root, using sudo would require http_* env vars to be carried through. * Add a systemd unit file to configure docker proxy support * Update /etc/bashrc if available proxy TrivialFix Change-Id: If2571389ec3dc5bce9e819acf962d202b3166b97
Diffstat (limited to 'dev/vagrant/bootstrap.sh')
-rw-r--r--dev/vagrant/bootstrap.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/dev/vagrant/bootstrap.sh b/dev/vagrant/bootstrap.sh
index ace58ecba..7e8a006b0 100644
--- a/dev/vagrant/bootstrap.sh
+++ b/dev/vagrant/bootstrap.sh
@@ -21,7 +21,8 @@ else
REGISTRY_PORT=5000
SUPPORT_NODE=support01
fi
-REGISTRY=operator.local:${REGISTRY_PORT}
+REGISTRY_URL="operator.local"
+REGISTRY=${REGISTRY_URL}:${REGISTRY_PORT}
ADMIN_PROTOCOL="http"
function _ensure_lsb_release {
@@ -30,9 +31,9 @@ function _ensure_lsb_release {
fi
if [[ -x $(which apt-get 2>/dev/null) ]]; then
- sudo apt-get install -y lsb-release
+ apt-get install -y lsb-release
elif [[ -x $(which yum 2>/dev/null) ]]; then
- sudo yum -y install redhat-lsb-core
+ yum -y install redhat-lsb-core
fi
}
@@ -124,6 +125,20 @@ EOF
exit 1
fi
+ if [[ "${http_proxy}" != "" ]]; then
+ mkdir -p /etc/systemd/system/docker.service.d
+ cat >/etc/systemd/system/docker.service.d/http-proxy.conf <<-EOF
+[Service]
+Environment="HTTP_PROXY=${http_proxy}" "HTTPS_PROXY=${https_proxy}"
+"NO_PROXY=localhost,127.0.0.1,${REGISTRY_URL}"
+EOF
+
+ if [[ "$(grep http_ /etc/bashrc)" == "" ]]; then
+ echo "export http_proxy=${http_proxy}" >> /etc/bashrc
+ echo "export https_proxy=${https_proxy}" >> /etc/bashrc
+ fi
+ fi
+
systemctl daemon-reload
systemctl enable docker
systemctl start docker