diff options
| author | Sam Yaple <sam@yaple.net> | 2015-07-23 11:25:42 +0000 |
|---|---|---|
| committer | Sam Yaple <sam@yaple.net> | 2015-07-23 12:15:31 +0000 |
| commit | 77f71b9f59d2900d1536a2a72a01779a61d8fd94 (patch) | |
| tree | 6dd84130bf7d8bc6daa45a8e3e10b46d55409e23 /docker/common | |
| parent | 6d4a55060e13723138facd90dc9786e7f2c3684b (diff) | |
| download | kolla-77f71b9f59d2900d1536a2a72a01779a61d8fd94.tar.gz kolla-77f71b9f59d2900d1536a2a72a01779a61d8fd94.zip | |
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
Diffstat (limited to 'docker/common')
| -rwxr-xr-x | docker/common/openvswitch/ovs-vswitchd/ovs_ensure_configured.sh | 17 |
1 files changed, 17 insertions, 0 deletions
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 |
