diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-27 15:22:25 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-10 10:55:34 +0000 |
commit | 461a25c256476192fdd953dc6304b7961677b8ff (patch) | |
tree | 60e6db2cc4a6864f540d29f151b008e10da433ab /openstack/usr/share/openstack/openvswitch.yml | |
parent | 823020ce0fc12f8c7de4dd398a93213be962dc39 (diff) | |
download | definitions-461a25c256476192fdd953dc6304b7961677b8ff.tar.gz |
openvswitch: Move setup scripts to Ansible.
Also change systemd units and configure extension to match this change
Diffstat (limited to 'openstack/usr/share/openstack/openvswitch.yml')
-rw-r--r-- | openstack/usr/share/openstack/openvswitch.yml | 40 |
1 files changed, 40 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..dd6eeac0 --- /dev/null +++ b/openstack/usr/share/openstack/openvswitch.yml @@ -0,0 +1,40 @@ +#!/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={{ item }} enabled=yes state=started + with_items: + - openvswitch.service + - openstack-neutron-setup.service |