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

dnf_config_manager: incompatibility with DNF5 #9127

Open
1 task done
hmenke opened this issue Nov 14, 2024 · 2 comments
Open
1 task done

dnf_config_manager: incompatibility with DNF5 #9127

hmenke opened this issue Nov 14, 2024 · 2 comments
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@hmenke
Copy link

hmenke commented Nov 14, 2024

Summary

DNF5 has completely changed the command line interface from DNF4. Among other things, the --verbose global option was removed entirely. However, the dnf_config_manager component hardcodes not only the path to DNF, but also the --verbose option in the call to repolist.

DNF_BIN = "/usr/bin/dnf"
REPO_ID_RE = re.compile(r'^Repo-id\s*:\s*(\S+)$')
REPO_STATUS_RE = re.compile(r'^Repo-status\s*:\s*(disabled|enabled)$')
def get_repo_states(module):
rc, out, err = module.run_command([DNF_BIN, 'repolist', '--all', '--verbose'], check_rc=True)

Issue Type

Bug Report

Component Name

dnf_config_manager

Ansible Version

$ ansible --version
ansible [core 2.16.12]
  config file = /tmp/ansible-test/ansible.cfg
  configured module search path = ['/tmp/ansible-test/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.13/site-packages/ansible
  ansible collection location = /tmp/ansible-test/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.13.0 (main, Oct  8 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/lib/python3.13/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 8.6.6 

Configuration

$ ansible-config dump --only-changed
ANSIBLE_HOME(/tmp/ansible-test/ansible.cfg) = /tmp/ansible-test/.ansible
ANSIBLE_NOCOWS(/tmp/ansible-test/ansible.cfg) = True
ANSIBLE_PIPELINING(/tmp/ansible-test/ansible.cfg) = True
CONFIG_FILE() = /tmp/ansible-test/ansible.cfg
DEFAULT_HOST_LIST(/tmp/ansible-test/ansible.cfg) = ['/tmp/ansible-test/hosts.yml']
DEFAULT_STDOUT_CALLBACK(/tmp/ansible-test/ansible.cfg) = yaml
EDITOR(env: EDITOR) = emacsclient -c -a "" -t

OS / Environment

Fedora Linux 41 (Workstation Edition)

Steps to Reproduce

- name: Enable Cisco OpenH264 repository.
  community.general.dnf_config_manager:
    name: fedora-cisco-openh264
    state: enabled

Expected Results

No error

Actual Results

fatal: [localhost]: FAILED! => changed=false 
  cmd: /usr/bin/dnf repolist --all --verbose
  msg: Unknown argument "--verbose" for command "repolist". Add "--help" for more information about the arguments.
  rc: 2
  stderr: |-
    Unknown argument "--verbose" for command "repolist". Add "--help" for more information about the arguments.
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

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

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants