1
0
mirror of https://github.com/openshift/openshift-ansible.git synced 2026-02-05 06:46:04 +01:00

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.
This commit is contained in:
Brent Barbachem
2023-09-14 11:56:44 -04:00
parent cf7777f2ba
commit 6154dfba01
4 changed files with 3 additions and 57 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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