community.general icon indicating copy to clipboard operation
community.general copied to clipboard

community.general.dnf_config_manager Hangs on repolist after activating repository

Open OrioQuezac opened this issue 5 months ago • 2 comments

Summary

When using community.general.dnf_config_manager, the process gets stuck after activating a repository (like PGDG extras repository). The module performs the following steps:

  1. Lists existing repositories to check if the target repository is available and whether it is active. This step completes successfully.
  2. Activates the repository if necessary.
  3. Runs a second repolist to verify if the repository was activated (I think).

At this point, the process hangs, as dnf requests the import of the GPG key for the repository.

Issue Type

Bug Report

Component Name

dnf_config_manager

Ansible Version

$ ansible --version
ansible [core 2.17.3]
  config file = /home/orio/Documents/work/logs_monit/ansible.cfg
  configured module search path = ['/home/orio/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/orio/.local/pipx/venvs/ansible/lib/python3.11/site-packages/ansible
  ansible collection location = /home/orio/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/orio/.local/bin/ansible
  python version = 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] (/home/orio/.local/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /home/orio/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 9.3.0  

# /home/orio/.local/pipx/venvs/ansible/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 9.3.0  

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

  1. Install PGDG repositories on managed nodes
  2. Run a playbook with dnf_config_manager module in it to enable pgdg-rhel9-extras :
- name: Ensure the PGDG Extra repository is enabled
  community.general.dnf_config_manager:
    name: pgdg-rhel9-extras
    state: enabled

Expected Results

The dnf_config_manager module should complete the repository activation process without blocking. After repository activation, if the GPG key needs to be imported, the module should handle this automatically (perhaps by adding --assumeyes to the repolist command).

Actual Results

Task with this module hangs.

Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

OrioQuezac avatar Sep 05 '24 09:09 OrioQuezac