X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=eaf79d7c0f51342b0c61baa289d7c4522e2cccdc;hb=refs%2Fchanges%2F43%2F8943%2F2;hp=47bcdb2d767fdc267392b92efd559c0a4666a093;hpb=8267106e698eab0c95d16a0e46fbd7333f22aab4;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 47bcdb2d..eaf79d7c 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -125,7 +125,8 @@ function remove_iptables() { fi if [ -z "$DEFAULT_IP" ]; then - DEFAULT_IF=`route -n |awk '$1~/^0.0.0.0/ {print $8}'` + DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}') + [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}') [ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0" DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'` [ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route" @@ -166,6 +167,12 @@ function remove_k8s_namespace() { kubectl delete ns $1 } +#Uninstall osmclient +function uninstall_osmclient() { + sudo apt-get remove --purge -y python-osmclient + sudo apt-get remove --purge -y python3-osmclient +} + #Uninstall lightweight OSM: remove dockers function uninstall_lightweight() { if [ -n "$INSTALL_ONLY" ]; then @@ -212,6 +219,7 @@ EONG $WORKDIR_SUDO rm -rf $OSM_DOCKER_WORK_DIR [ -z "$CONTROLLER_NAME" ] && sg lxd -c "juju destroy-controller --destroy-all-models --yes $OSM_STACK_NAME" fi + uninstall_osmclient echo "Some docker images will be kept in case they are used by other docker stacks" echo "To remove them, just run 'docker image prune' in a terminal" return 0 @@ -256,7 +264,8 @@ function install_lxd() { sudo usermod -a -G lxd `whoami` cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$DEFAULT_IP':8443/' | sg lxd -c "lxd init --preseed" sg lxd -c "lxd waitready" - DEFAULT_INTERFACE=$(route -n | awk '$1~/^0.0.0.0/ {print $8}') + DEFAULT_INTERFACE=$(ip route list|awk '$1=="default" {print $5; exit}') + [ -z "$DEFAULT_INTERFACE" ] && DEFAULT_INTERFACE=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}') DEFAULT_MTU=$(ip addr show $DEFAULT_INTERFACE | perl -ne 'if (/mtu\s(\d+)/) {print $1;}') sg lxd -c "lxc profile device set default eth0 mtu $DEFAULT_MTU" #sudo systemctl stop lxd-bridge @@ -386,7 +395,7 @@ function juju_createcontroller() { if ! juju show-controller $OSM_STACK_NAME &> /dev/null; then # Not found created, create the controller sudo usermod -a -G lxd ${USER} - sg lxd -c "juju bootstrap $OSM_VCA_CLOUDNAME $OSM_STACK_NAME" + sg lxd -c "juju bootstrap --bootstrap-series=xenial $OSM_VCA_CLOUDNAME $OSM_STACK_NAME" fi [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed" } @@ -921,9 +930,10 @@ function install_lightweight() { echo "Installing lightweight build of OSM" LWTEMPDIR="$(mktemp -d -q --tmpdir "installosmlight.XXXXXX")" trap 'rm -rf "${LWTEMPDIR}"' EXIT - DEFAULT_IF=`route -n |awk '$1~/^0.0.0.0/ {print $8}'` + DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}') + [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}') [ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0" - DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'` + DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'` [ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route" DEFAULT_MTU=$(ip addr show ${DEFAULT_IF} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')