diff --git a/inventory/group_vars/all/all.yml b/inventory/group_vars/all/all.yml index 2b1a9b139f..787de21ecb 100644 --- a/inventory/group_vars/all/all.yml +++ b/inventory/group_vars/all/all.yml @@ -45,24 +45,12 @@ default_bind_mount_logs: true # in order to create a more sensible repo name for the distro. os_distro_version: "{{ (ansible_facts['distribution'] | lower) | replace(' ', '_') }}-{{ ansible_facts['distribution_version'].split('.')[:2] | join('.') }}-{{ ansible_facts['architecture'] | lower }}" -# Set the systemd prefix based on the base OS. -systemd_utils_distro_prefix: - apt: "/lib/systemd" - yum: "/lib/systemd" - dnf: "/lib/systemd" - zypper: "/usr/lib/systemd" - -systemd_utils_prefix: "{{ systemd_utils_distro_prefix[ansible_facts['pkg_mgr']] }}" - openstack_lock_dir: "/run/lock" # Ensure that the package state matches the global setting rsyslog_client_package_state: "{{ package_state }}" -# At this time there's no suitable package available for systemd-journal-remote/gateway -# When installing on SUSE 42.x. For now this playbook will omit suse when the package -# manager is "zypper". When a suitable package is available on SUSE this should be removed. -rsyslog_client_enabled: "{{ ansible_facts['pkg_mgr'] == 'zypper' }}" -rsyslog_server_enabled: "{{ ansible_facts['pkg_mgr'] == 'zypper' }}" +rsyslog_client_enabled: False +rsyslog_server_enabled: False # URL for the frozen internal openstack repo. repo_server_port: 8181 diff --git a/inventory/group_vars/all/ceph.yml b/inventory/group_vars/all/ceph.yml index 2449cdf9b9..6915b035cf 100644 --- a/inventory/group_vars/all/ceph.yml +++ b/inventory/group_vars/all/ceph.yml @@ -22,7 +22,7 @@ osd_group_name: ceph-osd rgw_group_name: ceph-rgw mds_group_name: ceph-mds nfs_group_name: ceph-nfs -ceph_origin: "{{ (ansible_facts['pkg_mgr'] == 'zypper') | ternary('distro', 'repository') }}" +ceph_origin: repository ceph_repository: community # The _stable_release var is used by both the OSA ceph_client role and the # ceph-ansible roles. It is defaulted in ceph_client but set here to keep the diff --git a/inventory/group_vars/ceph-rgw.yml b/inventory/group_vars/ceph-rgw.yml index d775f54fc4..d791a9c62c 100644 --- a/inventory/group_vars/ceph-rgw.yml +++ b/inventory/group_vars/ceph-rgw.yml @@ -1,6 +1,6 @@ --- ceph_conf_overrides_rgw: - "client.rgw.{{ hostvars[inventory_hostname]['ansible_hostname'] }}.rgw0": + "client.rgw.{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }}.rgw0": # OpenStack integration with Keystone rgw_keystone_url: "{{ keystone_service_adminuri }}" rgw_keystone_api_version: 3 diff --git a/inventory/group_vars/utility_all.yml b/inventory/group_vars/utility_all.yml index e26656ba44..0aea30d018 100644 --- a/inventory/group_vars/utility_all.yml +++ b/inventory/group_vars/utility_all.yml @@ -30,7 +30,7 @@ utility_venv_bin: "/openstack/venvs/utility-{{ openstack_release }}/bin" utility_distro_packages: - git - bash-completion - - "{{ (ansible_pkg_mgr == 'apt') | ternary('debianutils', 'which') }}" + - "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('debianutils', 'which') }}" # Distribution packages needed for the utility pip package wheel build _utility_devel_distro_packages_debian: diff --git a/playbooks/ceph-install.yml b/playbooks/ceph-install.yml index 64950577a4..03a62bc441 100644 --- a/playbooks/ceph-install.yml +++ b/playbooks/ceph-install.yml @@ -63,7 +63,7 @@ owner: "root" mode: "0755" when: - - ansible_facts['pkg_mgr'] in ['yum', 'dnf'] + - ansible_facts['pkg_mgr'] == 'dnf' - ansible_facts['service_mgr'] == 'systemd' - name: Add systemd override for PrivateDevices @@ -73,7 +73,7 @@ [Service] PrivateDevices=false when: - - ansible_facts['pkg_mgr'] in ['yum', 'dnf'] + - ansible_facts['pkg_mgr'] == 'dnf' - ansible_facts['service_mgr'] == 'systemd' roles: diff --git a/playbooks/common-tasks/ceph-server.yml b/playbooks/common-tasks/ceph-server.yml index 481513c60f..332738fa25 100644 --- a/playbooks/common-tasks/ceph-server.yml +++ b/playbooks/common-tasks/ceph-server.yml @@ -28,7 +28,7 @@ name: libselinux-python3 state: present when: - - ansible_facts['pkg_mgr'] in ['yum', 'dnf'] + - ansible_facts['pkg_mgr'] == 'dnf' # Set the priority of the ceph community apt repo either above or below that of UCA or distro sources - name: Set apt package pins diff --git a/playbooks/infra-journal-remote.yml b/playbooks/infra-journal-remote.yml index 9dd7b6756c..25cdd85134 100644 --- a/playbooks/infra-journal-remote.yml +++ b/playbooks/infra-journal-remote.yml @@ -29,14 +29,6 @@ name: systemd-journald state: restarted pre_tasks: - # At this time there's no suitable package available for systemd-journal-remote/gateway - # When installing on SUSE 42.x. For now this playbook will omit suse when the package - # manager is "zypper". When a suitable package is available on SUSE this should be removed. - - name: Omit suse from this playbook - meta: end_play - when: - - ansible_facts['pkg_mgr'] == 'zypper' - - name: Skip playbook if log_hosts group is empty meta: end_play when: @@ -104,7 +96,7 @@ enabled: "{{ (ansible_host != systemd_journal_remote_target) | ternary('no', 'yes') }}" state: "{{ (ansible_host != systemd_journal_remote_target) | ternary('stopped', 'started') }}" execstarts: >- - {{ systemd_utils_prefix }}/systemd-journal-remote + /lib/systemd/systemd-journal-remote --listen-http=-3 --split-mode=host --compress @@ -118,7 +110,7 @@ enabled: "{{ (ansible_host == systemd_journal_remote_target) | ternary('no', 'yes') }}" state: "{{ (ansible_host == systemd_journal_remote_target) | ternary('stopped', 'started') }}" execstarts: >- - {{ systemd_utils_prefix }}/systemd-journal-upload + /lib/systemd/systemd-journal-upload --save-state --merge --url=http://{{ systemd_journal_remote_target }}:19532 diff --git a/playbooks/utility-install.yml b/playbooks/utility-install.yml index 12768c54b4..932b673b37 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -88,7 +88,7 @@ package: name: "{{ utility_distro_packages | default([]) }}" state: "{{ utility_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/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 9427e45288..3d8da4012c 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -90,12 +90,6 @@ case ${DISTRO_ID} in python3-apt python3-venv \ python3-minimal wget ;; - opensuse*) - zypper -n install -l git-core curl autoconf gcc gcc-c++ \ - netcat-openbsd python python-xml python-devel gcc \ - libffi-devel libopenssl-devel python-setuptools \ - patterns-devel-python-devel_python3 - ;; esac # Load nodepool PIP mirror settings diff --git a/scripts/log-collect.sh b/scripts/log-collect.sh index d3d2499f63..b0975c1476 100755 --- a/scripts/log-collect.sh +++ b/scripts/log-collect.sh @@ -81,30 +81,15 @@ function repo_information { [[ "${1}" != "host" ]] && lxc_cmd="lxc-attach --name ${1} --" || lxc_cmd="" echo "Collecting list of installed packages and enabled repositories for \"${1}\"" # Redhat package debugging - if eval sudo ${lxc_cmd} which yum &>/dev/null || eval sudo ${lxc_cmd} which dnf &>/dev/null; then - # Prefer dnf over yum for CentOS. - eval sudo ${lxc_cmd} which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum' - eval sudo ${lxc_cmd} $RHT_PKG_MGR repolist -v > "${WORKING_DIR}/logs/redhat-rpm-repolist-${1}-${TS}.txt" || true - eval sudo ${lxc_cmd} $RHT_PKG_MGR list installed > "${WORKING_DIR}/logs/redhat-rpm-list-installed-${1}-${TS}.txt" || true - - # SUSE package debugging - elif eval sudo ${lxc_cmd} which zypper &>/dev/null; then - eval sudo ${lxc_cmd} zypper lr -d > "${WORKING_DIR}/logs/suse-zypper-repolist-${1}-${TS}.txt" || true - eval sudo ${lxc_cmd} zypper --disable-repositories pa -i > "${WORKING_DIR}/logs/suse-zypper-list-installed-${1}-${TS}.txt" || true + if eval sudo ${lxc_cmd} which dnf &>/dev/null; then + eval sudo ${lxc_cmd} dnf repolist -v > "${WORKING_DIR}/logs/redhat-rpm-repolist-${1}-${TS}.txt" || true + eval sudo ${lxc_cmd} dnf list installed > "${WORKING_DIR}/logs/redhat-rpm-list-installed-${1}-${TS}.txt" || true # Ubuntu package debugging elif eval sudo ${lxc_cmd} which apt-get &> /dev/null; then eval sudo ${lxc_cmd} apt-cache policy | grep http | awk '{print $1" "$2" "$3}' | sort -u > "${WORKING_DIR}/logs/ubuntu-apt-repolist-${1}-${TS}.txt" || true eval sudo ${lxc_cmd} apt list --installed > "${WORKING_DIR}/logs/ubuntu-apt-list-installed-${1}-${TS}.txt" || true - - # Gentoo package debugging - elif eval sudo ${lxc_cmd} which emerge &> /dev/null; then - # list installed packages - eval sudo ${lxc_cmd} equery list "*" > "${WORKING_DIR}/logs/gentoo-portage-list-installed-${1}-${TS}.txt" || true - # list only packages called for install (not dependancies) - eval sudo ${lxc_cmd} cat /var/lib/portage/world > "${WORKING_DIR}/logs/gentoo-portage-list-manual-installed-${1}-${TS}.txt" || true fi - } function store_artifacts { diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index c6be6ca530..d9c21d247e 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -217,9 +217,6 @@ function run_dstat { apt-get update DEBIAN_FRONTEND=noninteractive apt-get -y install dstat ;; - opensuse) - zypper -n install -l dstat - ;; esac # https://stackoverflow.com/a/20338327 executing in ()& decouples the dstat @@ -334,7 +331,7 @@ function get_instance_info { determine_distro case ${DISTRO_ID} in - centos|rhel|fedora|opensuse) + centos|rhel) rpm -qa | sort > \ "/openstack/log/instance-info/host_packages_info_${TS}.log" || true ;; diff --git a/tests/bootstrap-aio.yml b/tests/bootstrap-aio.yml index 94c1afafed..ef21a81cd8 100644 --- a/tests/bootstrap-aio.yml +++ b/tests/bootstrap-aio.yml @@ -26,9 +26,7 @@ vars: sftp_subsystem: 'apt': 'sftp /usr/lib/openssh/sftp-server' - 'yum': 'sftp /usr/libexec/openssh/sftp-server' 'dnf': 'sftp /usr/libexec/openssh/sftp-server' - 'zypper': 'sftp /usr/lib/ssh/sftp-server' sshd: ListenAddress: - 0.0.0.0 diff --git a/tests/roles/bootstrap-host/defaults/main.yml b/tests/roles/bootstrap-host/defaults/main.yml index 9c71bae7af..e432f587fd 100644 --- a/tests/roles/bootstrap-host/defaults/main.yml +++ b/tests/roles/bootstrap-host/defaults/main.yml @@ -118,18 +118,10 @@ bootstrap_host_network_utils: iptables: /sbin/iptables ethtool: /sbin/ethtool ip: /sbin/ip - yum: - iptables: /usr/sbin/iptables - ethtool: /usr/sbin/ethtool - ip: /usr/sbin/ip dnf: iptables: /usr/sbin/iptables ethtool: /usr/sbin/ethtool ip: /usr/sbin/ip - zypper: - iptables: /usr/sbin/iptables - ethtool: /sbin/ethtool - ip: /sbin/ip # bootstrap_host_iptables_path: "{{ bootstrap_host_network_utils[ansible_facts['pkg_mgr']]['iptables'] }}" bootstrap_host_ethtool_path: "{{ bootstrap_host_network_utils[ansible_facts['pkg_mgr']]['ethtool'] }}" diff --git a/tests/roles/bootstrap-host/tasks/install_packages.yml b/tests/roles/bootstrap-host/tasks/install_packages.yml index 9d4a3635c4..c75f431a79 100644 --- a/tests/roles/bootstrap-host/tasks/install_packages.yml +++ b/tests/roles/bootstrap-host/tasks/install_packages.yml @@ -24,7 +24,7 @@ package: name: "{{ packages_install }}" state: present - update_cache: "{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}" tags: - install-packages diff --git a/tests/roles/bootstrap-host/tasks/prepare_loopback_zfs.yml b/tests/roles/bootstrap-host/tasks/prepare_loopback_zfs.yml index 4a8ffc9a49..d5a0c7e9f3 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_loopback_zfs.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_loopback_zfs.yml @@ -17,7 +17,7 @@ package: name: "{{ packages_install_zfs }}" state: present - update_cache: "{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}" tags: - install-packages diff --git a/tests/roles/bootstrap-host/tasks/prepare_squid.yml b/tests/roles/bootstrap-host/tasks/prepare_squid.yml index 85f0309742..9b233091b4 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_squid.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_squid.yml @@ -17,7 +17,7 @@ package: name: squid state: present - update_cache: "{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}" + update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}" notify: Restart squid tags: - install-packages diff --git a/tests/roles/bootstrap-host/vars/suse.yml b/tests/roles/bootstrap-host/vars/suse.yml deleted file mode 100644 index ddfed0aa0c..0000000000 --- a/tests/roles/bootstrap-host/vars/suse.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# Copyright 2015, 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. - -packages_install: - - bridge-utils - - btrfsprogs - - curl - - dbus-1 - - ethtool - - git-core - - iptables - - lvm2 - - python3 - - python3-devel - - vim - - vlan - - xfsprogs - -packages_remove: [] - -rc_local: /etc/rc.d/boot.local -rc_local_insert_before: EOF diff --git a/zuul.d/playbooks/pre-gate-cleanup.yml b/zuul.d/playbooks/pre-gate-cleanup.yml index 7552203e19..d6dcb4db73 100644 --- a/zuul.d/playbooks/pre-gate-cleanup.yml +++ b/zuul.d/playbooks/pre-gate-cleanup.yml @@ -28,7 +28,7 @@ regexp: 'https' replace: "http" when: - - ansible_distribution_release in ['focal'] + - ansible_facts['distribution_release'] in ['focal'] - name: Remove package excludes for yum/dnf lineinfile: