aboutsummaryrefslogtreecommitdiff
path: root/tests/init-core-openstack.sh
blob: 07c267a6cd1971449469abc58a31f55b1e5cda74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

set -o xtrace
set -o errexit
set -o pipefail

export PYTHONUNBUFFERED=1


function init_runonce {
    . /etc/kolla/admin-openrc.sh
    . ~/openstackclient-venv/bin/activate

    echo "Initialising OpenStack resources via init-runonce"
    KOLLA_DEBUG=1 tools/init-runonce |& gawk '{ print strftime("%F %T"), $0; }' &> /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