X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=979f604e18fdbffaf19a1566d935b7d8749bcce0;hb=refs%2Fchanges%2F57%2F8257%2F3;hp=8384224e84e562006bcdd70c3d978d8e5d31b723;hpb=8339ed24e9270f4cd7aa34bb632505d8d72f6c4a;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 8384224e..979f604e 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -132,6 +132,19 @@ function remove_network() { sg docker -c "docker network rm net${stack}" } +function remove_iptables() { + stack=$1 + if [ -z "$OSM_VCA_HOST" ]; then + OSM_VCA_HOST=`sg lxd -c "juju show-controller ${stack}"|grep api-endpoints|awk -F\' '{print $2}'|awk -F\: '{print $1}'` + [ -z "$OSM_VCA_HOST" ] && FATAL "Cannot obtain juju controller IP address" + fi + + if sudo iptables -t nat -C PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST; then + sudo iptables -t nat -D PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST + sudo netfilter-persistent save + fi +} + function remove_stack() { stack=$1 if sg docker -c "docker stack ps ${stack}" ; then @@ -202,6 +215,7 @@ EONG remove_volumes $OSM_STACK_NAME remove_network $OSM_STACK_NAME fi + remove_iptables $OSM_STACK_NAME echo "Removing $OSM_DOCKER_WORK_DIR" $WORKDIR_SUDO rm -rf $OSM_DOCKER_WORK_DIR sg lxd -c "juju destroy-controller --destroy-all-models --yes $OSM_STACK_NAME" @@ -564,12 +578,12 @@ function install_osmclient(){ CLIENT_REPOSITORY_BASE=${REPOSITORY_BASE#"-u "} key_location=$CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE/$CLIENT_REPOSITORY_KEY curl $key_location | sudo apt-key add - - sudo add-apt-repository -y "deb [arch=amd64] $CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE $CLIENT_REPOSITORY osmclient" + sudo add-apt-repository -y "deb [arch=amd64] $CLIENT_REPOSITORY_BASE/$CLIENT_RELEASE $CLIENT_REPOSITORY osmclient IM" sudo apt-get update - sudo apt-get install -y python-pip - sudo -H LC_ALL=C pip install -U pip - sudo -H LC_ALL=C python -m pip install python-magic - sudo apt-get install -y python-osmclient + sudo apt-get install -y python3-pip + sudo -H LC_ALL=C python3 -m pip install -U pip + sudo -H LC_ALL=C python3 -m pip install -U python-magic pyangbind + sudo apt-get install -y python3-osm-im python3-osmclient #sed 's,OSM_SOL005=[^$]*,OSM_SOL005=True,' -i ${HOME}/.bashrc #echo 'export OSM_HOSTNAME=localhost' >> ${HOME}/.bashrc #echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc