diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-16 18:58:04 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-20 11:22:17 +0000 |
commit | f4d0da51819e228ccf8fa17aec9cee7669518539 (patch) | |
tree | d20d52b64257327fcb76bcb0a6b149b70445bdc3 /openstack/usr/share/openstack/openvswitch.yml | |
parent | 3052f43715f67a57664290726908e00e8f35e42f (diff) | |
download | definitions-f4d0da51819e228ccf8fa17aec9cee7669518539.tar.gz |
Move openvswitch setup to Ansible
Diffstat (limited to 'openstack/usr/share/openstack/openvswitch.yml')
-rw-r--r-- | openstack/usr/share/openstack/openvswitch.yml | 37 |
1 files changed, 37 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..80c7f9f8 --- /dev/null +++ b/openstack/usr/share/openstack/openvswitch.yml @@ -0,0 +1,37 @@ +#!/bin/sh +--- +- hosts: localhost + tasks: + + - name: Create openvswitch directories + file: path={{ item }} state=directory + with_items: + - /usr/local/etc/openvswitch + - /usr/local/var/run/openvswitch + + - shell: > + ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema + creates=/usr/local/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=openvswitch.service enabled=yes state=started |