Feature 10593 Air-gapped installation. OSM behind proxy
Change-Id: Iac74e39fb00a396de1a6a971c35962a6688dad06
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/installers/install_lxd.sh b/installers/install_lxd.sh
index a499eae..ed50135 100755
--- a/installers/install_lxd.sh
+++ b/installers/install_lxd.sh
@@ -63,15 +63,24 @@
# sudo systemctl --system daemon-reload
# sudo systemctl enable lxd-bridge
# sudo systemctl start lxd-bridge
+
+ # Configure LXD to work behind a proxy
+ if [ -n "${OSM_BEHIND_PROXY}" ] ; then
+ [ -n "${HTTP_PROXY}" ] && sg lxd -c "lxc config set core.proxy_http $HTTP_PROXY"
+ [ -n "${HTTPS_PROXY}" ] && sg lxd -c "lxc config set core.proxy_https $HTTPS_PROXY"
+ [ -n "${NO_PROXY}" ] && sg lxd -c "lxc config set core.proxy_ignore_hosts $NO_PROXY"
+ fi
+
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
DEBUG_INSTALL=""
LXD_VERSION=5.0
OSM_DEVOPS=
+OSM_BEHIND_PROXY=""
# main
-while getopts ":D:d:i:-: h" o; do
+while getopts ":D:d:i:-: hP" o; do
case "${o}" in
i)
DEFAULT_IP="${OPTARG}"
@@ -82,6 +91,9 @@
D)
OSM_DEVOPS="${OPTARG}"
;;
+ P)
+ OSM_BEHIND_PROXY="y"
+ ;;
-)
[ "${OPTARG}" == "help" ] && usage && exit 0
[ "${OPTARG}" == "debug" ] && DEBUG_INSTALL="y" && continue
@@ -110,6 +122,7 @@
echo "DEBUG_INSTALL=$DEBUG_INSTALL"
echo "DEFAULT_IP=$DEFAULT_IP"
+echo "OSM_BEHIND_PROXY=$OSM_BEHIND_PROXY"
echo "OSM_DEVOPS=$OSM_DEVOPS"
[ -z "$INSTALL_NOJUJU" ] && install_lxd