Add option to just configure prerouting rules

Change-Id: Ia297cc98201388231a0a4c4338790dd5734bb432
This commit is contained in:
Melissa Kam 2017-04-25 14:22:18 -05:00
parent 3dcb39b79d
commit 0b581feae3
3 changed files with 25 additions and 15 deletions

View File

@ -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
------------------

View File

@ -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

View File

@ -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}"
OSA_PORTS="${OSA_PORTS:-6080 6082 443 80}"
# Should we configure prerouting of service ports after deployment
CONFIG_PREROUTING="${CONFIG_PREROUTING:-true}"