#!/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