From 9ce814619aa951f7d87b14f2ca67e7128ac12d2c Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Wed, 2 Dec 2015 21:05:16 +0000 Subject: configure ovs bridge in openvswitch-db container - this change moves the ovs_ensure_configured.sh file to the openvswitch-db container. - this change reorders the plays in ansible/roles/neutron/tasks/start.yml to configure the ovs bridges before starting the vswitchd container. Change-Id: Ied1a82d48377534c15680406df9a96caf3b79515 Closes-Bug: #1522133 --- docker/openvswitch/openvswitch-db-server/Dockerfile.j2 | 3 ++- .../openvswitch-db-server/ovs_ensure_configured.sh | 17 +++++++++++++++++ docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 | 3 +-- .../openvswitch-vswitchd/ovs_ensure_configured.sh | 17 ----------------- 4 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh delete mode 100644 docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh (limited to 'docker') diff --git a/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 b/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 index 8692f8cee..1bcc6e71e 100644 --- a/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 +++ b/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 @@ -1,7 +1,8 @@ FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }} MAINTAINER {{ maintainer }} +COPY ovs_ensure_configured.sh /usr/local/bin/kolla_ensure_openvswitch_configured COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 755 /usr/local/bin/kolla_extend_start +RUN chmod 755 /usr/local/bin/kolla_ensure_openvswitch_configured /usr/local/bin/kolla_extend_start {{ include_footer }} diff --git a/docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh b/docker/openvswitch/openvswitch-db-server/ovs_ensure_configured.sh new file mode 100644 index 000000000..99bae3e87 --- /dev/null +++ b/docker/openvswitch/openvswitch-db-server/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 --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 diff --git a/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 b/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 index 43f3ca55e..8692f8cee 100644 --- a/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 +++ b/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 @@ -1,8 +1,7 @@ FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }} MAINTAINER {{ maintainer }} -COPY ovs_ensure_configured.sh /usr/local/bin/kolla_ensure_openvswitch_configured COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_ensure_openvswitch_configured +RUN chmod 755 /usr/local/bin/kolla_extend_start {{ include_footer }} diff --git a/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh b/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh deleted file mode 100644 index c39d64ff7..000000000 --- a/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/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