Add ovs to neutron repo

In upstream we don't have a separated ovs repo.

Change-Id: If027e953f38408aabcdcce475b9742a6fb26ec04
This commit is contained in:
Proskurin Kirill 2016-07-06 15:57:56 +03:00
parent 1c7e104ade
commit 3bd0e9ed94
7 changed files with 107 additions and 0 deletions

View File

@ -0,0 +1,7 @@
FROM {{ namespace }}/base-tools:{{ tag }}
MAINTAINER {{ maintainer }}
RUN apt-get -y install --no-install-recommends \
openvswitch-switch \
&& apt-get clean

View File

@ -0,0 +1,2 @@
FROM {{ namespace }}/openvswitch-base:{{ tag }}
MAINTAINER {{ maintainer }}

View File

@ -0,0 +1,3 @@
FROM {{ namespace }}/openvswitch-base:{{ tag }}
MAINTAINER {{ maintainer }}

View File

@ -0,0 +1,6 @@
#!/bin/bash
mkdir -p "/run/openvswitch"
if [[ ! -e "/etc/openvswitch/conf.db" ]]; then
ovsdb-tool create "/etc/openvswitch/conf.db"
fi

View File

@ -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

View File

@ -0,0 +1,31 @@
service:
name: openvswitch-db
host-net: true
daemonset: true
node-selector:
openstack-compute-controller: "true"
containers:
- name: openvswitch-db
image: openvswitch-db
probes:
readiness: "true"
liveness: "true"
volumes:
- name: run
type: host
path: /run
pre:
- name: ovs-bootstrap
command: /opt/ccp/bin/openvswitch-db-bootstrap.sh
dependencies:
- rabbitmq
- neutron-db-sync
daemon:
command: /usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --log-file=/var/log/openvswitch/ovsdb-server.log
files:
- openvswitch-db-bootstrap.sh
files:
openvswitch-db-bootstrap.sh:
path: /opt/ccp/bin/openvswitch-db-bootstrap.sh
content: openvswitch-db-bootstrap.sh
perm: "0755"

View File

@ -0,0 +1,41 @@
service:
name: openvswitch-vswitchd
host-net: true
daemonset: true
node-selector:
openstack-compute-controller: "true"
containers:
- name: openvswitch-vswitchd
image: openvswitch-vswitchd
privileged: true
probes:
readiness: "true"
liveness: "true"
volumes:
- name: run
type: host
path: /run
- name: modules
type: host
path: /lib/modules
pre:
- name: vswitchd-bootstrap
command: modprobe openvswitch
- name: vswitchd-check-ovs-db
command: ovs-vsctl --no-wait show
dependencies:
- vswitchd-bootstrap
- openvswitch-db
- name: vswitchd-setup-ovs-bridge
command: /usr/local/bin/ovs-ensure-configured.sh {{ neutron_bridge_name }} {{ neutron_external_interface }}
dependencies:
- vswitchd-check-ovs-db
daemon:
command: /usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock --mlockall
files:
- ovs-ensure-configured.sh
files:
ovs-ensure-configured.sh:
path: /usr/local/bin/ovs-ensure-configured.sh
content: ovs-ensure-configured.sh
perm: "0755"