summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack/openvswitch.yml
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-04-13 15:57:48 +0000
committerFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-04-13 15:57:48 +0000
commit31f8afcf80cacf8cbfffd7cbdfc75241d8e3a223 (patch)
tree8fc55cdecba638aa86b6b913be0eb869aea620ed /openstack/usr/share/openstack/openvswitch.yml
parent736a9e13e5586063e7a188b6cb57e9c1aea3b6d8 (diff)
downloaddefinitions-baserock/openstack-baserock-upstream-all.tar.gz
Change-Id: I882fb2ad7a4cdbbd9daf11d802b4f84d1b79b03b
Diffstat (limited to 'openstack/usr/share/openstack/openvswitch.yml')
-rw-r--r--openstack/usr/share/openstack/openvswitch.yml39
1 files changed, 39 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/openvswitch.yml b/openstack/usr/share/openstack/openvswitch.yml
new file mode 100644
index 00000000..8331c639
--- /dev/null
+++ b/openstack/usr/share/openstack/openvswitch.yml
@@ -0,0 +1,39 @@
+#!/bin/sh
+---
+- hosts: localhost
+ tasks:
+
+ - name: Create openvswitch directories
+ file: path={{ item }} state=directory
+ with_items:
+ - /etc/openvswitch
+ - /var/run/openvswitch
+
+ - shell: >
+ ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
+ creates=/etc/openvswitch/conf.db
+
+ # We enable the openvswitch-db-server in a different task to identify
+ # the first time we run this script by identifying when we enable the
+ # unit.
+ #
+ # We need to identify this to initialise the database.
+ - name: Enable openvswitch database service
+ service: name={{ item }} enabled=yes
+ with_items:
+ - openvswitch-db-server.service
+ register: openvswitch_db_enable
+
+ - name: Start openvswitch database service
+ service: name={{ item }} state=started
+ with_items:
+ - openvswitch-db-server.service
+
+ - name: initialise openvswitch-db
+ shell: ovs-vsctl --no-wait init
+ when: openvswitch_db_enable|changed
+
+ - name: Enable and start openstack-keystone service
+ service: name={{ item }} enabled=yes state=started
+ with_items:
+ - openvswitch.service