From f4e20a1f16b3c2d2adb1d516df80950e197a374d Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 16 Mar 2020 15:58:11 +0000 Subject: [PATCH] Remove support for CentOS 7 CentOS 8 support is now fairly complete - time to drop CentOS 7. Partially-Implements: blueprint centos-rhel-8 Change-Id: I940b1d3eceb98e16fa366c243672f588b1412d70 --- ansible/group_vars/all.yml | 6 +++--- ansible/roles/baremetal/defaults/main.yml | 6 ++---- ansible/roles/baremetal/tasks/install.yml | 4 +--- ansible/roles/baremetal/tasks/pre-install.yml | 2 -- ansible/roles/haproxy/templates/haproxy_run.sh.j2 | 4 +--- ansible/roles/iscsi/tasks/precheck.yml | 1 - tests/deploy-ceph-ansible.sh | 7 +------ tests/run.yml | 6 +----- tests/templates/globals-default.j2 | 8 -------- tools/setup_gate.sh | 2 +- 10 files changed, 10 insertions(+), 36 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 148112835f..26932c5cff 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -844,7 +844,7 @@ gnocchi_metric_datadir_volume: "gnocchi" cinder_backend_ceph: "no" cinder_backend_vmwarevc_vmdk: "no" cinder_volume_group: "cinder-volumes" -cinder_target_helper: "{{ 'lioadm' if ansible_os_family == 'RedHat' and ansible_distribution_major_version is version_compare('8', '>=') else 'tgtadm' }}" +cinder_target_helper: "{{ 'lioadm' if ansible_os_family == 'RedHat' else 'tgtadm' }}" # Valid options are [ '', redis, etcd ] cinder_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}" @@ -1051,9 +1051,9 @@ kafka_datadir_volume: "kafka" # Internal Image options ######################### distro_python_version_map: { - "centos": "{{ '3.6' if ansible_distribution_major_version is version(8, '>=') else '2.7' }}", + "centos": "3.6", "debian": "3.7", - "rhel": "{{ '3.6' if ansible_distribution_major_version is version(8, '>=') else '2.7' }}", + "rhel": "3.6", "ubuntu": "3.6" } diff --git a/ansible/roles/baremetal/defaults/main.yml b/ansible/roles/baremetal/defaults/main.yml index 4a28dc2034..6bd35e2b85 100644 --- a/ansible/roles/baremetal/defaults/main.yml +++ b/ansible/roles/baremetal/defaults/main.yml @@ -11,8 +11,7 @@ docker_apt_package: "docker-ce" # Docker Yum repository configuration. docker_yum_url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}" -# FIXME(mgoddard): Use {{ ansible_distribution_major_version | lower }} rather -# than 7. +# FIXME(mgoddard): $releasever rather than 7. docker_yum_baseurl: "{{ docker_yum_url }}/7/$basearch/stable" docker_yum_gpgkey: "{{ docker_yum_url }}/gpg" docker_yum_gpgcheck: true @@ -46,8 +45,7 @@ easy_install_available: >- not (ansible_distribution == 'Debian' and ansible_distribution_major_version is version(10, 'ge')) and - not (ansible_os_family == 'RedHat' and - ansible_distribution_major_version is version(8, 'ge')) }} + not ansible_os_family == 'RedHat' }} # Version of python used to execute Ansible modules. host_python_version: "{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}" diff --git a/ansible/roles/baremetal/tasks/install.yml b/ansible/roles/baremetal/tasks/install.yml index 4dbb03c454..afbd706eac 100644 --- a/ansible/roles/baremetal/tasks/install.yml +++ b/ansible/roles/baremetal/tasks/install.yml @@ -55,10 +55,8 @@ register: apt_install_result - name: Install deltarpm packages - vars: - package_name: "{{ 'deltarpm' if ansible_distribution_major_version == '7' else 'drpm' }}" package: - name: "{{ package_name }}" + name: drpm state: present update_cache: yes become: True diff --git a/ansible/roles/baremetal/tasks/pre-install.yml b/ansible/roles/baremetal/tasks/pre-install.yml index 44c8b1692f..13c96942ce 100644 --- a/ansible/roles/baremetal/tasks/pre-install.yml +++ b/ansible/roles/baremetal/tasks/pre-install.yml @@ -139,8 +139,6 @@ line: "module_hotfixes = True" state: present become: True - when: - - ansible_distribution_major_version == '8' - name: Install docker rpm gpg key rpm_key: diff --git a/ansible/roles/haproxy/templates/haproxy_run.sh.j2 b/ansible/roles/haproxy/templates/haproxy_run.sh.j2 index c556e6f9f4..91cf78f4a9 100644 --- a/ansible/roles/haproxy/templates/haproxy_run.sh.j2 +++ b/ansible/roles/haproxy/templates/haproxy_run.sh.j2 @@ -1,6 +1,4 @@ #!/bin/bash -x -{% set has_haproxy_1_8=kolla_base_distro in ['debian', 'ubuntu'] or (kolla_base_distro == 'centos' and ansible_distribution_major_version is version(8, '>=')) %} -{% set haproxy_cmd='/usr/sbin/haproxy -W -db' if has_haproxy_1_8 else '/usr/sbin/haproxy-systemd-wrapper' %} # We need to run haproxy with one `-f` for each service, because including an # entire config directory was not a feature until version 1.7 of HAProxy. @@ -8,4 +6,4 @@ # This will run haproxy_cmd *exactly once*. find /etc/haproxy/services.d/ -mindepth 1 -print0 | \ xargs -0 -Icfg echo -f cfg | \ - xargs {{ haproxy_cmd }} -p /run/haproxy.pid -f /etc/haproxy/haproxy.cfg + xargs /usr/sbin/haproxy -W -db -p /run/haproxy.pid -f /etc/haproxy/haproxy.cfg diff --git a/ansible/roles/iscsi/tasks/precheck.yml b/ansible/roles/iscsi/tasks/precheck.yml index fed4e3a34b..e9fce75f8f 100644 --- a/ansible/roles/iscsi/tasks/precheck.yml +++ b/ansible/roles/iscsi/tasks/precheck.yml @@ -24,5 +24,4 @@ The SCSI target daemon tgtd is not supported on CentOS/RHEL 8 and later when: - ansible_os_family == 'RedHat' - - ansible_distribution_major_version is version_compare('8', '>=') - enable_tgtd | bool diff --git a/tests/deploy-ceph-ansible.sh b/tests/deploy-ceph-ansible.sh index 43ce02fcf4..b018521f12 100755 --- a/tests/deploy-ceph-ansible.sh +++ b/tests/deploy-ceph-ansible.sh @@ -8,12 +8,7 @@ export PYTHONUNBUFFERED=1 function setup_ceph_ansible { # Prepare virtualenv for ceph-ansible deployment - # NOTE(mnasiadka): Use python2 on centos7 due to missing python3 selinux bindings - if [[ $BASE_DISTRO == "centos" ]] && [[ $BASE_DISTRO_MAJOR_VERSION -eq 8 ]]; then - virtualenv --system-site-packages ~/ceph-venv - else - virtualenv -p `which python2` --system-site-packages ~/ceph-venv - fi + virtualenv --system-site-packages ~/ceph-venv ~/ceph-venv/bin/pip install -Ir requirements.txt ~/ceph-venv/bin/pip install -IU selinux } diff --git a/tests/run.yml b/tests/run.yml index 78eca77131..ee291715fe 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -11,8 +11,6 @@ vars: # NOTE(yoctozepto): needed here to use in other facts too openstack_core_enabled: "{{ scenario not in ['bifrost', 'mariadb'] }}" - # TODO(mgoddard): Remove when previous_release is ussuri. - is_centos8: "{{ ansible_os_family == 'RedHat' and ansible_distribution_major_version | int == 8 }}" set_fact: kolla_inventory_path: "/etc/kolla/inventory" logs_dir: "/tmp/logs" @@ -26,7 +24,7 @@ openstack_core_tested: "{{ scenario in ['core', 'ceph-ansible', 'zun', 'cells', 'swift', 'linuxbridge'] }}" dashboard_enabled: "{{ openstack_core_enabled }}" # TODO(mgoddard): Remove when previous_release is ussuri. - playbook_python_version: "{{ '2' if is_upgrade and previous_release == 'train' and not is_centos8 else '3' }}" + playbook_python_version: "{{ '2' if is_upgrade and previous_release == 'train' and ansible_os_family != 'RedHat' else '3' }}" upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt" - name: Install xfsprogs package for Swift filesystems @@ -276,7 +274,6 @@ chdir: "{{ kolla_ansible_src_dir }}" environment: BASE_DISTRO: "{{ base_distro }}" - BASE_DISTRO_MAJOR_VERSION: "{{ ansible_distribution_major_version }}" INSTALL_TYPE: "{{ install_type }}" BUILD_IMAGE: "{{ need_build_image }}" TAG: "{{ build_image_tag }}" @@ -310,7 +307,6 @@ chdir: "{{ ceph_ansible_src_dir }}" environment: BASE_DISTRO: "{{ base_distro }}" - BASE_DISTRO_MAJOR_VERSION: "{{ ansible_distribution_major_version }}" - name: Ensure required kolla config directories exist file: diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index e1217ba4b2..b95efdb3ff 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -1,12 +1,4 @@ --- -{% if ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' %} -# Force the use of python2 on CentOS7 remote hosts. This is necessary for -# delegate_to: localhost, which will otherwise use the local python interpreter -# (python3). On CentOS 7, that fails due to a lack of python3 bindings for -# SELinux. https://bugs.centos.org/view.php?id=16389 -ansible_python_interpreter: /usr/bin/python2 -{% endif %} - kolla_base_distro: "{{ base_distro }}" kolla_install_type: "{{ install_type }}" network_interface: "{{ api_interface_name }}" diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index 7dfae456c8..47628d966e 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -45,7 +45,7 @@ function prepare_images { if [[ $SCENARIO == "zun" ]]; then GATE_IMAGES+=",^zun,^kuryr,^etcd,^cinder,^iscsid" - if [[ $BASE_DISTRO != "centos" ]] || [[ $BASE_DISTRO_MAJOR_VERSION -eq 7 ]]; then + if [[ $BASE_DISTRO != "centos" ]]; then GATE_IMAGES+=",^tgtd" fi fi