From 7b03c1b5b152df7bc963d09acd8d3725b66490b5 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: I4a68549bf85fd322ea344139869916aae3275377 --- meta/main.yml | 9 +-- tasks/drivers/kvm/nova_compute_kvm.yml | 29 +------ tasks/drivers/kvm/nova_enable_ksm.yml | 3 +- tasks/nova_install.yml | 2 +- templates/nova.conf.j2 | 4 - vars/redhat.yml | 25 +++--- vars/suse.yml | 101 ------------------------- 7 files changed, 19 insertions(+), 154 deletions(-) delete mode 100644 vars/suse.yml diff --git a/meta/main.yml b/meta/main.yml index 08047f83..868119cb 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/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index 89f83c75..4f16d9b2 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -140,7 +140,7 @@ when: - (nova_libvirtd_listen_tcp == 1) or (nova_libvirtd_listen_tls == 1) - libvirtd_version is version('5.7', '<') - - ansible_facts['pkg_mgr'] in ['yum', 'dnf', 'zypper'] + - ansible_facts['pkg_mgr'] == 'dnf' notify: Restart libvirt-bin tags: - nova-config @@ -155,7 +155,7 @@ backup: "yes" when: - (nova_libvirtd_listen_tcp == 0 and nova_libvirtd_listen_tls == 0) or libvirtd_version is version('5.7', '>=') - - ansible_facts['pkg_mgr'] in ['yum', 'dnf', 'zypper'] + - ansible_facts['pkg_mgr'] == 'dnf' notify: Restart libvirt-bin tags: - nova-config @@ -194,28 +194,3 @@ - nova-kvm - nova-libvirt - nova-kvm-virsh-net - -# NOTE(mnaser): These 2 tasks should disappear once the following bug is fixed -# https://bugs.launchpad.net/nova/+bug/1825386 -- name: Create UEFI firmware folder - file: - path: /usr/share/OVMF - state: directory - when: - - ansible_facts['os_family'] == 'Suse' - tags: - - nova-config - - nova-kvm - - nova-libvirt - -- name: Symlink UEFI firmware files - file: - src: "{{ (ansible_facts['os_family'] == 'RedHat') | ternary('/usr/share/OVMF/OVMF_CODE.secboot.fd', '/usr/share/qemu/ovmf-x86_64-ms-code.bin') }}" - dest: /usr/share/OVMF/OVMF_CODE.fd - state: link - when: - - ansible_facts['os_family'] in ['RedHat', 'Suse'] - tags: - - nova-config - - nova-kvm - - nova-libvirt diff --git a/tasks/drivers/kvm/nova_enable_ksm.yml b/tasks/drivers/kvm/nova_enable_ksm.yml index c7203133..0e93ee8d 100644 --- a/tasks/drivers/kvm/nova_enable_ksm.yml +++ b/tasks/drivers/kvm/nova_enable_ksm.yml @@ -11,4 +11,5 @@ enabled: yes state: started when: - - ansible_facts['pkg_mgr'] in ['yum', 'dnf', 'apt'] + - ansible_facts['pkg_mgr'] in [dnf', 'apt'] + diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index 59ebe389..943b0d6f 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -39,7 +39,7 @@ package: name: "{{ nova_package_list }}" state: "{{ nova_package_state }}" - update_cache: "{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages is success diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index 757a8ab7..1f957ec1 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -19,10 +19,6 @@ compute_driver = {{ nova_compute_driver }} instances_path = {{ nova_system_home_folder }}/instances allow_resize_to_same_host = True -{% if ansible_facts['os_family'] | lower == 'suse' %} -mkisofs_cmd = /usr/bin/mkisofs -{% endif %} - {% if nova_console_user_ssl_cert is defined and nova_console_user_ssl_key is defined and ( nova_services['nova-novncproxy']['group'] in group_names or nova_services['nova-spicehtml5proxy']['group'] in group_names or nova_services['nova-serialconsole-proxy']['group'] in group_names ) %} # Console SSL keys ssl_only = true diff --git a/vars/redhat.yml b/vars/redhat.yml index 9d044c11..da50e2f3 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -32,9 +32,9 @@ nova_service_distro_packages: - openstack-nova-api - openstack-nova-conductor - openstack-nova-scheduler - - "{{ ansible_facts['distribution_major_version'] is version('8', '<') | ternary('python-memcached', 'python3-memcached') }}" - - "{{ ansible_facts['distribution_major_version'] is version('8', '<') | ternary('python2-PyMySQL', 'python3-PyMySQL') }}" - - "{{ ansible_facts['distribution_major_version'] is version('8', '<') | ternary('systemd-python', 'python3-systemd') }}" + - python3-memcached + - python3-PyMySQL + - python3-systemd nova_service_extra_distro_packages: kvm: @@ -52,7 +52,7 @@ nova_compute_packages: - genisoimage - kpartx - nc - - "{{ ansible_facts['distribution_major_version'] is version('8', '<') | ternary('python-libguestfs', 'python3-libguestfs') }}" + - python3-libguestfs - sysfsutils nova_compute_barbican_distro_packages: @@ -60,20 +60,17 @@ nova_compute_barbican_distro_packages: nova_compute_kvm_distro_packages: - libvirt-daemon-kvm - - "qemu-kvm{% if ansible_facts['distribution_major_version']|int <= 7 %}-ev{% endif %}" + - qemu-kvm - libvirt-client - - "{{ (ansible_facts['distribution_major_version']|int <= 7) | ternary('libvirt-devel', 'python3-libvirt') }}" + - python3-libvirt - nfs-utils - - "{{ (ansible_facts['distribution_major_version']|int <= 7) | ternary('libguestfs-devel', 'python3-libguestfs') }}" - - "qemu-img{% if ansible_facts['distribution_major_version']|int <= 7 %}-ev{% endif %}" + - python3-libguestfs + - qemu-img - "{{ (ansible_facts['architecture'] == 'aarch64') | ternary('AAVMF', 'OVMF') }}" -nova_compute_kvm_packages_to_symlink: |- - {% set packages = [] %} - {% if ansible_facts['distribution_major_version']|int > 7 %} - {% set _ = packages.extend(['python3-libvirt', 'python3-libguestfs']) %} - {% endif %} - {{ packages }} +nova_compute_kvm_packages_to_symlink: + - python3-libvirt + - python3-libguestfs nova_compute_kvm_pip_packages: - http://download.libguestfs.org/python/guestfs-1.40.2.tar.gz diff --git a/vars/suse.yml b/vars/suse.yml deleted file mode 100644 index e51c5820..00000000 --- a/vars/suse.yml +++ /dev/null @@ -1,101 +0,0 @@ ---- -# Copyright 2014, 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. - -nova_qemu_user: qemu -nova_qemu_group: qemu -libvirt_group: libvirt -libvirt_service_name: libvirtd - -# Common yum packages -nova_distro_packages: - - git-core - - iptables - - libxml2 - -nova_devel_distro_packages: - - libxml2-devel - - systemd-devel - -nova_service_distro_packages: - - openstack-nova-api - - openstack-nova-conductor - - openstack-nova-scheduler - - python-memcached - - python-PyMySQL - - python-systemd - -nova_service_extra_distro_packages: - kvm: - - openstack-nova-compute - novnc: - - openstack-nova-novncproxy - spice: [] - serialconsole: - - openstack-nova-serialproxy - -nova_compute_packages: - - dosfstools - - mkisofs - - kpartx - - python3-libguestfs - - sysfsutils - -nova_compute_barbican_distro_packages: - - cryptsetup - -nova_compute_kvm_distro_packages: - - bridge-utils - - device-mapper - - dosfstools - - mkisofs - - open-iscsi - - kpartx - - libvirt-daemon-config-nwfilter - - libvirt-daemon-driver-qemu - - libvirt-daemon-driver-secret - - libvirt-daemon-driver-storage-core - - libvirt-daemon-driver-storage-disk - - libvirt-daemon-driver-storage-iscsi - - libvirt-daemon-driver-storage-logical - - libvirt-daemon-driver-storage-mpath - - libvirt-daemon-driver-storage-rbd - - libvirt-daemon-driver-storage-scsi - - netcat-openbsd - - qemu-block-iscsi - - qemu-block-rbd - - qemu-block-ssh - - qemu-kvm - - qemu-ovmf-x86_64 - - python2-libvirt-python - - python3-libvirt-python - - nfs-utils - - python2-libguestfs - - python3-libguestfs - - qemu-tools - - sysfsutils - -nova_compute_kvm_packages_to_symlink: - - python2-libvirt-python - - python3-libvirt-python - - python2-libguestfs - - python3-libguestfs - -nova_compute_ksm_packages: - - qemu-ksm - -nova_compute_oslomsg_amqp1_distro_packages: - - cyrus-sasl-plain - - cyrus-sasl-digestmd5