Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip_broken in dnf module doesnt have any effect #73072

Closed
shiron-babi opened this issue Dec 28, 2020 · 2 comments · Fixed by #78158
Closed

skip_broken in dnf module doesnt have any effect #73072

shiron-babi opened this issue Dec 28, 2020 · 2 comments · Fixed by #78158
Assignees
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. packaging Packaging category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. verified This issue has been verified/reproduced by maintainer

Comments

@shiron-babi
Copy link

SUMMARY

Trying to install a list of local packages via dnf module gives me conflicts on RHEL 8.2
I tried to add skip_broken flag but the conflicts error are still appear

dnf --disablerepo=* localinstall -y *.rpm --skip-broken
works well

Important notice: server should be without an outbound connection. (disconnected from internet)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

dnf

ANSIBLE VERSION
ansible 2.10.4
  config file = /mnt/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Aug 18 2020, 08:33:21) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
CONFIGURATION
DEFAULT_CALLBACK_WHITELIST(/mnt/ansible/ansible.cfg) = ['timer', 'profile_tasks']
DEFAULT_HASH_BEHAVIOUR(/mnt/ansible/ansible.cfg) = merge
DEFAULT_HOST_LIST(/mnt/ansible/ansible.cfg) = ['/mnt/ansible/inventory']
DEFAULT_LOAD_CALLBACK_PLUGINS(/mnt/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/mnt/ansible/ansible.cfg) = /mnt/ansible/ansible.log
DEFAULT_REMOTE_USER(/mnt/ansible/ansible.cfg) = ec2-user
DEFAULT_STDOUT_CALLBACK(/mnt/ansible/ansible.cfg) = debug
DEFAULT_VERBOSITY(/mnt/ansible/ansible.cfg) = 0
HOST_KEY_CHECKING(/mnt/ansible/ansible.cfg) = False
INVENTORY_ENABLED(/mnt/ansible/ansible.cfg) = ['host_list', 'virtualbox', 'constructed', 'script', 'auto', 'yaml', 'ini', 'toml']
RETRY_FILES_ENABLED(/mnt/ansible/ansible.cfg) = False
OS / ENVIRONMENT

RHEL 8.2 running on Azure

STEPS TO REPRODUCE
  1. on RHEL 8.3 - download nginx (for example) rpms and dependencies to a folder (dnf --downloadonly)
  2. Copy all to RHEL 8.2
  3. try to install these local rpms via dnf module
- name: INSTALL DEPENDENCIES ROLE | NGINX | INSTALL | Finding Nginx RPM files
  find:
    paths: "{{ local_repo_nginx_dir_path }}"
    patterns: "*.rpm"
  register: rpm_result

- set_fact:
    rpm_list: "{{ rpm_result.files | map(attribute='path') | list}}"

- name: INSTALL DEPENDENCIES ROLE | NGINX | INSTALL | Install all Nginx RPMs dependencies
  dnf:
    name: "{{ rpm_list }}"
    state: present
    disablerepo: "*"
    skip_broken: yes
EXPECTED RESULTS

nginx installation doesn't fail and playbook continue

ACTUAL RESULTS

playbook fails on dnf module

MSG:

Depsolve Error occured:
 Problem 1: package crypto-policies-20200713-1.git51d1222.el8.noarch conflicts with openssh < 8.0p1-5 provided by openssh-8.0p1-4.el8_1.x86_64
  - conflicting requests
  - problem with installed package openssh-8.0p1-4.el8_1.x86_64
 Problem 2: cannot install both util-linux-2.32.1-24.el8.x86_64 and util-linux-2.32.1-22.el8.x86_64
  - package util-linux-user-2.32.1-22.el8.x86_64 requires util-linux = 2.32.1-22.el8, but none of the providers can be installed
  - conflicting requests
  - problem with installed package util-linux-user-2.32.1-22.el8.x86_64
@ansibot
Copy link
Contributor

ansibot commented Dec 28, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. packaging Packaging category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Dec 28, 2020
@samdoran samdoran added needs_verified This issue needs to be verified/reproduced by maintainer and removed needs_triage Needs a first human triage before being processed. labels Jan 7, 2021
@relrod relrod added verified This issue has been verified/reproduced by maintainer and removed needs_verified This issue needs to be verified/reproduced by maintainer labels Feb 15, 2021
@relrod
Copy link
Member

relrod commented Feb 15, 2021

Verified. This is because even though we set strict (aka skip_broken) in the dnf base config, we don't actually pass it as strict (kwarg) when we call base.install(): https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/dnf.py#L743

There are a few other places as well. I'm working on a patch and was writing a bunch of test cases, but it was on my desktop and my power just went out, so my work got stalled 😆 -- I'll have a patch up soonish.

relrod added a commit to relrod/ansible that referenced this issue Apr 11, 2021
Change:
- skip_broken was set in config but not actually used in calls to
  base.install()
- added a lot of test cases with specialized repo
- got rid of external (docker repo) nobest test cases since the
  specialized repo works well for those too
- Slight cleanup and adding comments in dnf module

Test Plan:
- ci_complete

Tickets:
- Fixes ansible#73072

Signed-off-by: Rick Elrod <rick@elrod.me>
@ansibot ansibot added the has_pr This issue has an associated PR. label Nov 26, 2021
s-hertel pushed a commit that referenced this issue Jun 30, 2022
* [dnf] Fix skip_broken, add test coverage

Change:
- skip_broken was set in config but not actually used in calls to
  base.install()
- added a lot of test cases with specialized repo
- got rid of external (docker repo) nobest test cases since the
  specialized repo works well for those too
- Slight cleanup and adding comments in dnf module

Test Plan:
- ci_complete

Tickets:
- Fixes #73072

Original-author: Rick Elrod <rick@elrod.me>

* Use a better test for checking results list

ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>

Co-authored-by: Rick Elrod <rick@elrod.me>
@ansible ansible locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. packaging Packaging category python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. verified This issue has been verified/reproduced by maintainer
Projects
None yet
4 participants