fuel-ccp-neutron/service/files/ovs-ensure-configured.sh.j2

24 lines
418 B
Django/Jinja

#!/bin/bash
{% for net in neutron.physnets %}
bridge={{ net.bridge_name }}
port={{ net.interface }}
ip link set $port up
ovs-vsctl br-exists $bridge; rc=$?
if [[ $rc == 2 ]]; then
changed=changed
ovs-vsctl --no-wait add-br $bridge
fi
if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
changed=changed
ovs-vsctl --no-wait add-port $bridge $port
fi
echo $changed
{% endfor %}