infra.leapp icon indicating copy to clipboard operation
infra.leapp copied to clipboard

roles/upgrade/tasks/handle-old-packages.yml breaks rpm exclusion feature

Open StCyr opened this issue 1 month ago • 2 comments

In file roles/upgrade/tasks/handle-old-packages.yml packages matching the following rule are removed:

- name: handle-old-packages | Search for old packages and packages not versioned by rhel release
  ansible.builtin.shell:
    cmd: >-
      set -o pipefail;
      export PATH={{ os_path }};
      rpm -qa |
      grep -ve '[\.|+]el{{ ansible_distribution_major_version }}' |
      grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' |
      sort

This also matches non-redhat packages and breaks the rpm package exclusion feature documented in https://access.redhat.com/articles/4977891

Wouldn't be a good idea to filter out from this list packages that are found in the exclude setting in /etc/dnf/dnf.conf ?

I guess I can provide a patch if you agree with the idea.

StCyr avatar Nov 25 '25 07:11 StCyr

I'll let the Leapp experts comment / decide. The remove happens https://github.com/redhat-cop/infra.leapp/blob/main/roles/upgrade/tasks/handle-old-packages.yml#L58 and can be preventing by setting the following default variable to false in your playbook which includes the upgrade role https://github.com/redhat-cop/infra.leapp/blob/main/roles/upgrade/defaults/main.yml#L177.

I believe the remove was inline with the documentation when it was implemented.

jeffmcutter avatar Nov 25 '25 08:11 jeffmcutter

Ok, I'll try this variable. Thanks for your answer.

StCyr avatar Nov 25 '25 09:11 StCyr