From d8c643eeb2c02fb8c450be71fff5f9fddcb75481 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 10 Mar 2021 12:16:39 +0000 Subject: [PATCH] Remove references to unsupported operating systems All references to Gentoo, SUSE, Debian stretch and Centos-7 are removed. Conditional tasks, ternary operators and variables are simplified where possible OS specific variables files are generalised where possible Change-Id: I746e9c3246a257ca57c56b63c25a3cf9fcc49c9a --- meta/main.yml | 9 +-- tasks/main.yml | 1 - tasks/neutron_install.yml | 6 +- tasks/neutron_pre_install.yml | 20 +----- tasks/providers/ovn_config.yml | 4 +- vars/distro_install.yml | 4 +- vars/redhat.yml | 6 +- vars/source_install.yml | 4 +- vars/suse.yml | 110 --------------------------------- 9 files changed, 16 insertions(+), 148 deletions(-) delete mode 100644 vars/suse.yml diff --git a/meta/main.yml b/meta/main.yml index 1830000a..9cc5efe8 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -22,17 +22,14 @@ galaxy_info: platforms: - name: Debian versions: - - stretch + - buster - name: Ubuntu versions: - - xenial - bionic + - focal - name: EL versions: - - 7 - - name: opensuse - versions: - - 15 + - 8 categories: - cloud - python diff --git a/tasks/main.yml b/tasks/main.yml index 4e730658..f1649e9c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -107,7 +107,6 @@ - neutron_os_type is defined - neutron_os_type == 'powervm' - neutron_plugin_type == 'ml2.ovs' - - "{{ ansible_distribution_version is version('16.04','>') }}" tags: - neutron-config diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index a15a38d2..56bb52de 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_install.yml @@ -29,7 +29,7 @@ package: name: "{{ neutron_package_list }}" state: "{{ neutron_package_state }}" - update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages is success @@ -115,9 +115,9 @@ {%- endif -%} {%- endfor -%} {{ apparmor_hosts | unique }} - when: ansible_pkg_mgr in ['apt', 'zypper'] + when: ansible_pkg_mgr == 'apt' - import_tasks: neutron_apparmor.yml when: - - ansible_pkg_mgr in ['apt', 'zypper'] + - ansible_pkg_mgr == 'apt' - inventory_hostname in neutron_apparmor_hosts diff --git a/tasks/neutron_pre_install.yml b/tasks/neutron_pre_install.yml index b0c53fd4..a15d71a8 100644 --- a/tasks/neutron_pre_install.yml +++ b/tasks/neutron_pre_install.yml @@ -95,24 +95,6 @@ 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 - - name: Add dependency repos for Neutron package: name: "{{ neutron_repos }}" @@ -120,7 +102,7 @@ retries: 5 delay: 2 when: - - ansible_pkg_mgr in ['yum', 'dnf'] + - ansible_pkg_mgr == 'dnf' - neutron_needs_openvswitch | bool - name: Create ovs tempfiles directory diff --git a/tasks/providers/ovn_config.yml b/tasks/providers/ovn_config.yml index f96b70c1..b2053ebe 100644 --- a/tasks/providers/ovn_config.yml +++ b/tasks/providers/ovn_config.yml @@ -18,7 +18,7 @@ package: name: "{{ neutron_ovn_northd_distro_packages }}" state: "{{ neutron_package_state }}" - update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages is success @@ -31,7 +31,7 @@ package: name: "{{ neutron_ovn_controller_distro_packages }}" state: "{{ neutron_package_state }}" - update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages is success diff --git a/vars/distro_install.yml b/vars/distro_install.yml index 0fc6300f..8ebcb42e 100644 --- a/vars/distro_install.yml +++ b/vars/distro_install.yml @@ -26,9 +26,9 @@ neutron_package_list: |- {% set packages = neutron_distro_packages %} {% if neutron_needs_openvswitch | bool %} {% set _ = packages.extend(neutron_optional_ovs_distro_packages) %} - {% if (ovs_nsh_support and ansible_pkg_mgr in ['apt', 'zypper']) %} + {% if (ovs_nsh_support and ansible_pkg_mgr == 'apt') %} {% set _ = packages.extend(neutron_ovs_nsh_required_packages) %} - {% elif (ovs_dpdk_support and ansible_pkg_mgr in ['apt', 'zypper']) %} + {% elif (ovs_dpdk_support and ansible_pkg_mgr == 'apt') %} {% set _ = packages.extend(neutron_ovs_dpdk_required_packages) %} {% else %} {% set _ = packages.extend(neutron_ovs_distro_packages) %} diff --git a/vars/redhat.yml b/vars/redhat.yml index 1e3e7f62..b7b66c1b 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -60,8 +60,8 @@ neutron_service_distro_packages: - openstack-neutron-macvtap-agent - openstack-neutron-metering-agent - openstack-neutron-l2gw-agent - - "{{ ansible_distribution_major_version is version('8', '<') | ternary('python-memcached', 'python3-memcached') }}" - - "{{ ansible_distribution_major_version is version('8', '<') | ternary('systemd-python', 'python3-systemd') }}" + - python3-memcached + - python3-systemd neutron_optional_ovs_distro_packages: - openstack-neutron-openvswitch @@ -91,4 +91,4 @@ neutron_oslomsg_amqp1_distro_packages: - cyrus-sasl-plain - cyrus-sasl-md5 -_neutron_keepalived_no_track: "{{ (ansible_distribution_major_version is version('8', '>=')) }}" +_neutron_keepalived_no_track: True diff --git a/vars/source_install.yml b/vars/source_install.yml index 11bc48dc..8c420d33 100644 --- a/vars/source_install.yml +++ b/vars/source_install.yml @@ -25,9 +25,9 @@ neutron_package_list: |- {% set packages = neutron_distro_packages %} {% if neutron_needs_openvswitch | bool %} - {% if (ovs_nsh_support and ansible_pkg_mgr in ['apt', 'zypper']) %} + {% if (ovs_nsh_support and ansible_pkg_mgr == 'apt') %} {% set _ = packages.extend(neutron_ovs_nsh_required_packages) %} - {% elif (ovs_dpdk_support and ansible_pkg_mgr in ['apt', 'zypper']) %} + {% elif (ovs_dpdk_support and ansible_pkg_mgr == 'apt') %} {% set _ = packages.extend(neutron_ovs_dpdk_required_packages) %} {% else %} {% set _ = packages.extend(neutron_ovs_distro_packages) %} diff --git a/vars/suse.yml b/vars/suse.yml deleted file mode 100644 index 24bfa4e4..00000000 --- a/vars/suse.yml +++ /dev/null @@ -1,110 +0,0 @@ ---- -# Copyright 2016, Rackspace US, Inc. -# Copyright 2017, SUSE LINUX GmbH. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -neutron_ovs_distro_packages: - - openvswitch - -neutron_ovs_service_name: openvswitch - -neutron_ovn_northd_service_name: ovn-northd - -neutron_ovn_controller_service_name: ovn-controller - -neutron_ovs_socket_path: "/usr/local/var/run/openvswitch" - -neutron_ovs_nsh_required_packages: - - openvswitch-switch - -neutron_ovs_dpdk_required_packages: - - openvswitch-dpdk - -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_apparmor_distro_packages: - - apparmor-parser - - apparmor-profiles - - apparmor-utils - -neutron_distro_packages: - - conntrack-tools - - dnsmasq - - dnsmasq-utils - - ebtables - - ipset - - iptables - - iputils - - keepalived - - net-tools - - radvd - - which - -neutron_ovn_distro_packages: - - openvswitch-ovn-common - -neutron_ovn_controller_distro_packages: - - openvswitch-ovn-host - - haproxy - -neutron_ovn_northd_distro_packages: - - openvswitch-ovn-central - -neutron_devel_distro_packages: - - git-core - - systemd-devel - - python-httplib2 - -neutron_service_distro_packages: - - openstack-neutron - - openstack-neutron-dhcp-agent - - openstack-neutron-l3-agent - - openstack-neutron-metadata-agent - - openstack-neutron-metering-agent - - openstack-neutron-server - - python-memcached - - python-systemd - -neutron_optional_ovs_distro_packages: - - openstack-neutron-openvswitch-agent - -neutron_optional_lxb_distro_packages: - - openstack-neutron-linuxbridge-agent - -neutron_option_vpnaas_distro_packages: - - openstack-neutron-vpnaas - -neutron_lxb_distro_packages: - - bridge-utils - -neutron_vpnaas_distro_packages: - - openswan - -_neutron_driver_vpnaas: neutron_vpnaas.services.vpn.device_drivers.libreswan_ipsec.LibreSwanDriver -_neutron_vpnaas_service_provider: VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default - -neutron_metadata_agent_distro_packages: - - haproxy - -neutron_remove_distro_packages: [] - -neutron_oslomsg_amqp1_distro_packages: - - cyrus-sasl - - cyrus-sasl-plain - - cyrus-sasl-digestmd5