Skip to content
Snippets Groups Projects
Commit f7a207d0 authored by garciadeblas's avatar garciadeblas
Browse files

Setup IP address env vars before running installation of specific components


Change-Id: I5e03fbe660a68845726188c0abba9ecf78a28908
Signed-off-by: default avatargarciadeblas <gerardo.garciadeblas@telefonica.com>
parent dab1ac67
No related branches found
No related tags found
No related merge requests found
......@@ -473,6 +473,16 @@ function deploy_osm() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
function setup_external_ip() {
echo "Determining IP address of the interface with the default route"
[ -z "$OSM_DEFAULT_IF" ] && OSM_DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
[ -z "$OSM_DEFAULT_IF" ] && OSM_DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}')
[ -z "$OSM_DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
OSM_DEFAULT_IP=`ip -o -4 a s ${OSM_DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]; exit}'`
[ -z "$OSM_DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
OSM_K8S_EXTERNAL_IP=${OSM_K8S_EXTERNAL_IP:-${OSM_DEFAULT_IP}}
}
function install_osm() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
......@@ -497,13 +507,8 @@ function install_osm() {
[ -n "$DOCKER_REGISTRY_URL" ] && parse_docker_registry_url
echo "Determining IP address of the interface with the default route"
[ -z "$OSM_DEFAULT_IF" ] && OSM_DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
[ -z "$OSM_DEFAULT_IF" ] && OSM_DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}')
[ -z "$OSM_DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
OSM_DEFAULT_IP=`ip -o -4 a s ${OSM_DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]; exit}'`
[ -z "$OSM_DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
OSM_K8S_EXTERNAL_IP=${OSM_K8S_EXTERNAL_IP:-${OSM_DEFAULT_IP}}
echo "Setting up external IP address"
setup_external_ip
# configure apt proxy
[ -n "$APT_PROXY_URL" ] && configure_apt_proxy $APT_PROXY_URL
......@@ -1021,6 +1026,7 @@ else
# Community_installer
# Special cases go first
if [ -n "$INSTALL_ONLY" ]; then
setup_external_ip
[ -n "$INSTALL_ONLY_DOCKER_CE" ] && install_docker_ce
[ -n "$INSTALL_ONLY_K8S_CLUSTER" ] && install_k8s_cluster
[ -n "$INSTALL_K8S_MONITOR" ] && install_k8s_monitoring
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment