From 77f71b9f59d2900d1536a2a72a01779a61d8fd94 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Thu, 23 Jul 2015 11:25:42 +0000 Subject: 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 --- .../openvswitch/ovs-vswitchd/ovs_ensure_configured.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 docker/common/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh (limited to 'docker/common/openvswitch') diff --git a/docker/common/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh b/docker/common/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh new file mode 100755 index 000000000..c39d64ff7 --- /dev/null +++ b/docker/common/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh @@ -0,0 +1,17 @@ +#!/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 -- cgit v1.2.3