Bug fix for onos sfc 13/37613/1
authorYifei Xue <xueyifei@huawei.com>
Mon, 17 Jul 2017 09:21:12 +0000 (17:21 +0800)
committerYifei Xue <xueyifei@huawei.com>
Mon, 17 Jul 2017 09:21:12 +0000 (17:21 +0800)
Add the configuration of sfc driver in
networking-sfc and networking-onos.

Change-Id: I2f9345d2caa030960e707f15406cb22f6b525dc0
Signed-off-by: Yifei Xue <xueyifei@huawei.com>
deploy/adapters/ansible/roles/onos_cluster/files/driver.sh [new file with mode: 0755]
deploy/adapters/ansible/roles/onos_cluster/files/sfc_plugins.conf [changed mode: 0644->0755]
deploy/adapters/ansible/roles/onos_cluster/tasks/onos_sfc_controller.yml
deploy/adapters/ansible/roles/onos_cluster/vars/main.yml

diff --git a/deploy/adapters/ansible/roles/onos_cluster/files/driver.sh b/deploy/adapters/ansible/roles/onos_cluster/files/driver.sh
new file mode 100755 (executable)
index 0000000..97706db
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+sed -i '/\[networking_sfc.sfc.drivers\]/a onos = networking_onos.services.sfc.driver:OnosSfcDriver' /usr/local/lib/python2.7/dist-packages/networking_sfc-3.0.0.dist-info/entry_points.txt
+
+sed -i '/\[networking_sfc.flowclassifier.drivers\]/a onos = networking_onos.services.flowclassifier.driver:OnosFlowClassifierDriver' /usr/local/lib/python2.7/dist-packages/networking_sfc-3.0.0.dist-info/entry_points.txt
old mode 100644 (file)
new mode 100755 (executable)
index ddef928..a5049f6
@@ -2,3 +2,9 @@
 
 service_plugins = networking_sfc.services.sfc.plugin.SfcPlugin,networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin,onos_router
 
+[sfc]
+drivers = onos
+
+[flowclassifier]
+drivers = onos
+
index 2874d50..136e8da 100755 (executable)
     url: "http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ onos_driver }}"
     dest: /opt/
 
-- name: download onos sfc driver package
-  get_url:
-    url: "http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ onos_sfc_driver }}"
-    dest: /opt/
-
 - name: unarchive onos driver package
-  command: su -s /bin/sh -c "tar xvf  /opt/networking-onos.tar -C /opt/"
+  command: su -s /bin/sh -c "tar zxf  /opt/networking-onos.tar.gz -C /opt/"
+
+- name: upgrade stevedore
+  pip: name=stevedore state=latest
 
 - name: install onos driver
   command: su -s /bin/sh -c "/opt/networking-onos/install_driver.sh"
 - name: install networking-sfc
   pip: name=networking-sfc state=present version=3.0.0
 
+- name: copy driver_configuration script
+  copy:
+    src: driver.sh
+    dest: "/opt/driver.sh"
+    mode: 0777
+
+- name: Configure sfc driver
+  command: su -s /bin/sh -c "/opt/driver.sh;"
+
 - name: install onos required packages
   action: "{{ ansible_pkg_mgr }}  name={{ item }} state=present"
   with_items: "{{ packages }}"
 
 - name: Configure Neutron3
   shell: >
-    mysql -e "drop database if exists neutron_ml2;";
-    mysql -e "create database neutron_ml2 character set utf8;";
-    mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';";
+    mysql -e "drop database if exists neutron;";
+    mysql -e "create database neutron character set utf8;";
+    mysql -e "grant all on neutron.* to 'neutron'@'%' identified by \
+        '{{ NEUTRON_DBPASS }}';";
     su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
-    --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron;
+        --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron;
     su -s /bin/sh -c "neutron-db-manage --subproject networking-sfc upgrade head" neutron;
   when: inventory_hostname == haproxy_hosts.keys()[0]
 
index 3c3dd55..e140446 100755 (executable)
@@ -13,8 +13,8 @@ onos_home: /opt/onos/
 karaf_dist: apache-karaf-3.0.5
 jdk8_pkg_name: jdk-8u51-linux-x64.tar.gz
 jdk8_script_name: install_jdk8.tar
-onos_driver: networking-onos.tar
-onos_sfc_driver: networking-sfc.tar
+onos_driver: networking-onos.tar.gz
+onos_sfc_driver: networking-sfc.tar.gz
 repository: repository.tar
 sfc_plugins:
   src: sfc_plugins.conf