From 6154dfba014a09ece2872da074fd99056ae521c2 Mon Sep 17 00:00:00 2001 From: Brent Barbachem Date: Thu, 14 Sep 2023 11:56:44 -0400 Subject: [PATCH] OCPBUGS-18703: Correct upgrade for conflict packages. ** The yum module was originally having issues with upgrades (conflicts). Yum had a swap but the issues persisted. A custom workaround was used by downloading RPMs. The process worked except for upgrades. It appeared that the evs-vswitchd daemon was not correctly restarting causing lost connections during the upgrade process. The DNF module will use the --allowerasing option to remove and install the package at the same time, avoiding the issue. ** Also noting that there were sometimes issues when the upgrade for openvswitch would upgrade to a package of the same version. This problem has also been tested and works better with the DNF module. --- roles/openshift_node/defaults/main.yml | 3 -- roles/openshift_node/tasks/install.yml | 4 +- .../tasks/package_conflicts.yml | 50 ------------------- roles/openshift_node/tasks/upgrade.yml | 3 -- 4 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 roles/openshift_node/tasks/package_conflicts.yml diff --git a/roles/openshift_node/defaults/main.yml b/roles/openshift_node/defaults/main.yml index a17c30046..bd1a8ed96 100644 --- a/roles/openshift_node/defaults/main.yml +++ b/roles/openshift_node/defaults/main.yml @@ -86,9 +86,6 @@ openshift_node_support_packages_by_os_major_version: - openvswitch2.17 - policycoreutils-python-utils -openshift_conflict_packages: - - openvswitch - openshift_node_support_packages_by_arch: ppc64le: - irqbalance diff --git a/roles/openshift_node/tasks/install.yml b/roles/openshift_node/tasks/install.yml index 24b3c6f6b..c90a182ce 100644 --- a/roles/openshift_node/tasks/install.yml +++ b/roles/openshift_node/tasks/install.yml @@ -89,9 +89,11 @@ - block: - name: Install openshift packages - package: + dnf: name: "{{ openshift_packages }}" state: latest + allowerasing: true + disable_gpg_check: true async: 3600 poll: 30 register: result diff --git a/roles/openshift_node/tasks/package_conflicts.yml b/roles/openshift_node/tasks/package_conflicts.yml deleted file mode 100644 index 594471e91..000000000 --- a/roles/openshift_node/tasks/package_conflicts.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- name: Install manager to download packages - yum: - name: "yum-utils" - state: latest - -- name: Create a temporary directory for packages - file: - path: "{{ openshift_package_directory }}" - state: directory - -# not all packages can be safely or easily upgraded due to conflicts -# Download the rpms and then remove conflicting packages and install the new ones. -# A particular issue is openvswitch which conflicts with itself, but removing -# older versions of the package causes network issues. -- name: Download rpms for conflicting packages - command: "yumdownloader --destdir {{ openshift_package_directory }} {{ item }}" - with_items: "{{ openshift_node_support_packages_by_os_major_version[ansible_distribution_major_version] }}" - -- name: Find all downloaded rpms - find: - paths: "{{ openshift_package_directory }}" - patterns: "*.rpm" - register: rpms - -- name: Setting list of rpms - set_fact: - rpm_list: "{{ rpms.files | map(attribute='path') | list}}" - -- name: Remove known conflicts - yum: - name: "{{ item }}*" - state: absent - with_items: "{{ openshift_conflict_packages }}" - -- name: Install downloaded packages - yum: - name: "{{ rpm_list }}" - state: present - disable_gpg_check: true - -- name: Remove temporary directory - file: - path: "{{ openshift_package_directory }}" - state: absent - -- name: Remove temporary manager for downloaded packages - yum: - name: "yum-utils" - state: absent diff --git a/roles/openshift_node/tasks/upgrade.yml b/roles/openshift_node/tasks/upgrade.yml index 215f19f20..724cce8d1 100644 --- a/roles/openshift_node/tasks/upgrade.yml +++ b/roles/openshift_node/tasks/upgrade.yml @@ -25,9 +25,6 @@ - include_tasks: "{{ openshift_node_pre_upgrade_hook }}" when: openshift_node_pre_upgrade_hook is defined -# Manually upgrade challenging packages that may have conflicts during normal upgrade -- import_tasks: package_conflicts.yml - # Upgrade Node Packages - import_tasks: install.yml