From 02faf51e91a8c55adfbb6d953bca354ab99bf261 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Tue, 2 Jun 2015 08:40:27 +0000 Subject: Move all the directories used for install-files into a subdirectory Change-Id: I309c183ce8b9ff9d0f5ac4807244547f2cc4ddf5 --- .../openstack/usr/share/openstack/openvswitch.yml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 install-files/openstack/usr/share/openstack/openvswitch.yml (limited to 'install-files/openstack/usr/share/openstack/openvswitch.yml') diff --git a/install-files/openstack/usr/share/openstack/openvswitch.yml b/install-files/openstack/usr/share/openstack/openvswitch.yml new file mode 100644 index 00000000..47257f7f --- /dev/null +++ b/install-files/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 Open vSwitch service + service: name={{ item }} enabled=yes state=started + with_items: + - openvswitch.service -- cgit v1.2.1