From: Adam Israel Date: Wed, 6 Nov 2019 15:37:25 +0000 (-0500) Subject: Install iptables-persistent package X-Git-Tag: v6.0.4rc1~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F8138%2F1;p=osm%2Fdevops.git Install iptables-persistent package Installs the iptables-persistent package in order to make iptable changes persistent across reboots. This is necessary to allow native charms to communicate with Juju after a reboot. Change-Id: Iacda7d36fa714991356c27a9858d4eccd77e4383 Signed-off-by: Adam Israel --- diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 283c19da..c236242d 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -643,6 +643,17 @@ function juju_createcontroller() { [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed" } +function juju_createproxy() { + echo -e "\nChecking required packages: iptables-persistent" + dpkg -l iptables-persistent &>/dev/null || ! echo -e " Not installed.\nInstalling iptables-persistent requires root privileges" || \ + sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install iptables-persistent + + 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 -A PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST + sudo netfilter-persistent save + fi +} + function generate_docker_images() { echo "Pulling and generating docker images" _build_from=$COMMIT_ID