roles/upgrade/tasks/handle-old-packages.yml breaks rpm exclusion feature
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.
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.
Ok, I'll try this variable. Thanks for your answer.