diff --git a/multi-node-aio/README.rst b/multi-node-aio/README.rst index 509cf8d1..6fa32f18 100644 --- a/multi-node-aio/README.rst +++ b/multi-node-aio/README.rst @@ -148,6 +148,9 @@ Instruct the VM to use the selected image, eg. ubuntu xenial: Install the specified kernel, eg 3.13.0-34 if you want to deploy Juno release. ``DEFAULT_KERNEL=${DEFAULT_KERNEL:-3.13.0-34}`` +Configure the prerouting iptable rules after the OSA deployment + ``CONFIG_PREROUTING="${CONFIG_PREROUTING:-true}`` + Re-kicking the VMs ------------------ diff --git a/multi-node-aio/config-deploy-node.sh b/multi-node-aio/config-deploy-node.sh index ad64048a..075122f4 100755 --- a/multi-node-aio/config-deploy-node.sh +++ b/multi-node-aio/config-deploy-node.sh @@ -6,21 +6,25 @@ source functions.rc # bring in variable definitions if there is a variables.sh file [[ -f variables.sh ]] && source variables.sh -# Copy private key and public key to deploy node -scp -r -o StrictHostKeyChecking=no ~/.ssh deploy1:/root/ +if [[ "${DEPLOY_OSA}" = true ]]; then + # Copy private key and public key to deploy node + scp -r -o StrictHostKeyChecking=no ~/.ssh deploy1:/root/ -# Copy multi-node-aio folder to deploy node -scp -r -o StrictHostKeyChecking=no ../multi-node-aio deploy1:/root + # Copy multi-node-aio folder to deploy node + scp -r -o StrictHostKeyChecking=no ../multi-node-aio deploy1:/root -# Deploy openstack-ansible from deploy node and export all variables deploy-osa.sh needs -ssh -o StrictHostKeyChecking=no deploy1 "export NETWORK_BASE=${NETWORK_BASE} RUN_OSA=${RUN_OSA} " \ -"OSA_BRANCH=${OSA_BRANCH} PRE_CONFIG_OSA=${PRE_CONFIG_OSA}; apt update; cd /root/multi-node-aio/; ./deploy-osa.sh" + # Deploy openstack-ansible from deploy node and export all variables deploy-osa.sh needs + ssh -o StrictHostKeyChecking=no deploy1 "export NETWORK_BASE=${NETWORK_BASE} RUN_OSA=${RUN_OSA} " \ + "OSA_BRANCH=${OSA_BRANCH} PRE_CONFIG_OSA=${PRE_CONFIG_OSA}; apt update; cd /root/multi-node-aio/; ./deploy-osa.sh" +fi -# Add 2222 rules to iptables for ssh directly into deployment node. -iptables_filter_rule_add nat 'PREROUTING -p tcp --dport 2222 -j DNAT --to 10.0.0.150:22' +if [[ "${CONFIG_PREROUTING}" = true ]]; then + # Add 2222 rules to iptables for ssh directly into deployment node. + iptables_filter_rule_add nat 'PREROUTING -p tcp --dport 2222 -j DNAT --to 10.0.0.150:22' -scp -o StrictHostKeyChecking=no deploy1:/opt/openstack-ansible/playbooks/vars/configs/haproxy_config.yml . -PORTS="$(get_osad_ports) $OSA_PORTS" -for port in $PORTS ; do - iptables_filter_rule_add nat "PREROUTING -p tcp --dport ${port} -j DNAT --to 10.0.0.150:${port}" -done + scp -o StrictHostKeyChecking=no deploy1:/opt/openstack-ansible/playbooks/vars/configs/haproxy_config.yml . + PORTS="$(get_osad_ports) $OSA_PORTS" + for port in $PORTS ; do + iptables_filter_rule_add nat "PREROUTING -p tcp --dport ${port} -j DNAT --to 10.0.0.150:${port}" + done +fi \ No newline at end of file diff --git a/multi-node-aio/variables.sh b/multi-node-aio/variables.sh index e69195f5..98d9c052 100755 --- a/multi-node-aio/variables.sh +++ b/multi-node-aio/variables.sh @@ -44,4 +44,7 @@ PRE_CONFIG_OSA="${PRE_CONFIG_OSA:-true}" RUN_OSA="${RUN_OSA:-true}" # Default service ports -OSA_PORTS="${OSA_PORTS:-6080 6082 443 80}" \ No newline at end of file +OSA_PORTS="${OSA_PORTS:-6080 6082 443 80}" + +# Should we configure prerouting of service ports after deployment +CONFIG_PREROUTING="${CONFIG_PREROUTING:-true}" \ No newline at end of file