[ -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
[ -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
# 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