diff --git a/tasks/neutron_pre_install.yml b/tasks/neutron_pre_install.yml index 59fd87fb..ba79a245 100644 --- a/tasks/neutron_pre_install.yml +++ b/tasks/neutron_pre_install.yml @@ -79,3 +79,21 @@ mode: "0440" owner: "root" group: "root" + +- name: Add zypper repo for ovs-nsh package + zypper_repository: + repo: "{{ repo.repo }}" + state: "{{ repo.state | default('present') }}" + name: "{{ repo.name | default(omit) }}" + enabled: "{{ repo.enabled | default(omit) }}" + disable_gpg_check: "{{ repo.disable_gpg_check | default(omit) }}" + description: "{{ repo.description | default(omit) }}" + autorefresh: "{{ repo.autorefresh | default(omit) }}" + auto_import_keys: "{{ repo.auto_import_keys | default(omit) }}" + priority: "{{ repo.priority | default(omit) }}" + with_items: "{{ neutron_repos }}" + loop_control: + loop_var: repo + when: + - ansible_pkg_mgr == 'zypper' + - ovs_nsh_support | bool diff --git a/vars/main.yml b/vars/main.yml index c588a81b..6881abce 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -28,7 +28,7 @@ neutron_package_list: |- or (neutron_services['dragonflow-controller-agent']['group'] in group_names and neutron_services['dragonflow-controller-agent'].service_en | bool) or (neutron_services['dragonflow-l3-agent']['group'] in group_names and neutron_services['dragonflow-l3-agent'].service_en | bool) or ((neutron_services['neutron-server']['group'] not in group_names) and neutron_plugin_type == 'ml2.opendaylight') %} - {% if (ovs_nsh_support and ansible_distribution == 'Ubuntu') %} + {% if (ovs_nsh_support and ansible_pkg_mgr in ['apt', 'zypper']) %} {% set _ = packages.extend(neutron_ovs_nsh_required_packages) %} {% else %} {% set _ = packages.extend(neutron_ovs_distro_packages) %} diff --git a/vars/suse-42.yml b/vars/suse-42.yml index f25ff00f..12422338 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -21,6 +21,16 @@ neutron_ovs_distro_packages: neutron_ovs_service_name: openvswitch +neutron_ovs_nsh_required_packages: + - openvswitch-switch + +neutron_repos: + - repo: https://download.opensuse.org/repositories/home:/mosquetero/openSUSE_Leap_{{ ansible_distribution_version }}/ + name: ovs-nsh + autorefresh: yes + auto_import_keys: yes + priority: 98 + neutron_distro_packages: - conntrack-tools - dnsmasq