kolla-ansible/docker/common/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh
Sam Yaple 77f71b9f59 Adds the appropriate tools to addin the ovs bridge
Ansible will exec a script in the OVS container to ensure the bridge and
ports are properly setup. The script is idempotent.

Change-Id: I5adca595a4d2ef4edf26c9635cfa5ceb30ca4a59
Closes-Bug: #1466375
2015-07-23 12:15:31 +00:00

18 lines
291 B
Bash
Executable File

#!/bin/bash
bridge=$1
port=$2
ovs-vsctl br-exists $bridge; rc=$?
if [[ $rc == 2 ]]; then
changed=changed
ovs-vsctl add-br $bridge
fi
if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
changed=changed
ovs-vsctl add-port $bridge $port
fi
echo $changed