kolla-ansible/tests/init-core-openstack.sh
Radosław Piliszek 195813dd60 CI: Add addressing on external network
This is to allow CI testing of network connectivity.

Note only "primary" node gets an address on it.
Hence, "primary" becomes our fake external router.

Depends-on: https://review.opendev.org/709361

Change-Id: I05592888796107d6de95b940c42b2bff73ac0669
2020-02-26 13:27:00 +01:00

32 lines
936 B
Bash
Executable File

#!/bin/bash
set -o xtrace
set -o errexit
export PYTHONUNBUFFERED=1
function init_runonce {
. /etc/kolla/admin-openrc.sh
. ~/openstackclient-venv/bin/activate
echo "Initialising OpenStack resources via init-runonce"
tools/init-runonce &> /tmp/logs/ansible/init-runonce
echo "Setting address on the external network bridge"
if [[ $SCENARIO == "linuxbridge" ]]; then
# NOTE(yoctozepto): linuxbridge agent manages its bridges by itself
# hence, we need to find the current name of the external network bridge
devname=$(basename $(readlink /sys/class/net/${EXT_NET_SLAVE_DEVICE}/master))
else
devname=br-ex
# NOTE(yoctozepto): ovs virtual interfaces are down (not used) by default
# hence, we need to bring the external network bridge up
sudo ip link set ${devname} up
fi
sudo ip addr add ${EXT_NET_LOCAL_ADDR} dev ${devname}
}
init_runonce