summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack/openvswitch.yml
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-04-14 13:10:36 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-04-16 14:09:52 +0000
commit882c3912e7aea98ff6f945a7e6bdc926b1cfc790 (patch)
tree67c3530a3beaa48489fead3b6375fcb2898d5437 /openstack/usr/share/openstack/openvswitch.yml
parenteb5f7d081841925c5324411e6861119404e26a5d (diff)
downloaddefinitions-882c3912e7aea98ff6f945a7e6bdc926b1cfc790.tar.gz
Openstack: Add support to configure the network of the node
Change-Id: I8f8bfb231ab5ff4c2a825451a57a5b38a641c300 Signed-off-by: Pedro Alvarez <pedro.alvarez@codethink.co.uk> Signed-off-by: Richard Maw <richard.maw@codethink.co.uk>
Diffstat (limited to 'openstack/usr/share/openstack/openvswitch.yml')
-rw-r--r--openstack/usr/share/openstack/openvswitch.yml38
1 files changed, 38 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..4393e3db
--- /dev/null
+++ b/openstack/usr/share/openstack/openvswitch.yml
@@ -0,0 +1,38 @@
+---
+- 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