Modify openvswitch installation 41/60041/2
authorHarry Huang <huangxiangyu5@huawei.com>
Fri, 20 Jul 2018 09:12:25 +0000 (17:12 +0800)
committerHarry Huang <huangxiangyu5@huawei.com>
Mon, 23 Jul 2018 02:22:14 +0000 (02:22 +0000)
JIRA: COMPASS-604

1. Keep linux bridges when ODL scenario
2. degrade ovs to 2.8.0 for 2.9.0 has issue with ODL

Change-Id: I4433fb1bb4e2d64c7220296ca167f32e4a4246be
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
deploy/adapters/ansible/roles/post-osa/tasks/main.yml
deploy/adapters/ansible/roles/setup-openvswitch/tasks/main.yml
deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml [new file with mode: 0644]
deploy/adapters/ansible/roles/setup-openvswitch/vars/Debian.yml

index cf6ba1e..e7e4c37 100644 (file)
@@ -11,6 +11,7 @@
   when:
     - inventory_hostname in groups['compute']
     - ansible_distribution == 'Ubuntu'
+    - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch"
 
 # install networking-sfc for non odl scenarios
 - include: install_networking_sfc.yml
index 87e508c..2deecb3 100644 (file)
 - include: controller.yml
   when:
     - inventory_hostname not in groups['nova_compute']
-    - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or "opendaylight"
+    - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch"
 
 - include: compute.yml
   when:
     - inventory_hostname in groups['nova_compute']
-    - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or "opendaylight"
+    - NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch"
+
+- include_vars: "{{ ansible_os_family }}.yml"
+  when:
+    - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight"
+
+- include: odl.yml
+  when:
+    - NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight"
diff --git a/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml b/deploy/adapters/ansible/roles/setup-openvswitch/tasks/odl.yml
new file mode 100644 (file)
index 0000000..9c96a46
--- /dev/null
@@ -0,0 +1,25 @@
+#############################################################################
+# Copyright (c) 2017-2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+---
+- name: uninstall ovs for odl
+  apt:
+    name: "{{ item.name }}"
+    state: absent
+  with_items: "{{ ovs_pkgs }}"
+
+- name: download ovs pkgs
+  get_url:
+    url: "{{ item.url }}"
+    dest: "/tmp/{{ item.package }}"
+  with_items: "{{ ovs_pkgs }}"
+
+- name: install ovs pkgs
+  shell:
+    dpkg -i "/tmp/{{ item.package }}"
+  with_items: "{{ ovs_pkgs }}"
index b6bd95a..e998778 100644 (file)
@@ -1,3 +1,16 @@
 ---
 
 ovs_service: openvswitch-switch
+
+# yamllint disable rule:line-length
+ovs_pkgs:
+  - openvswitch-common:
+    name: openvswitch-common
+    package: openvswitch-common.deb
+    url: http://archive.ubuntu.com/ubuntu/pool/main/o/openvswitch/openvswitch-common_2.5.4-0ubuntu0.16.04.1_amd64.deb
+
+  - openvswitch-switch:
+    name: openvswitch-switch
+    package: openvswitch-switch.deb
+    url: http://archive.ubuntu.com/ubuntu/pool/main/o/openvswitch/openvswitch-switch_2.5.4-0ubuntu0.16.04.1_amd64.deb
+# yamllint enable rule:line-length