You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing dnf_config_manager with a remote user that has a locale not set to english (tested with LANG=fr_FR.UTF-8) the module fails with did not find repo with ID 'xxx' in dnf repolist --all --verbose.
The module uses a regex on the dnf repolist --all --verbose command output defined here :
But the dnf repolist --all --verbose command output is localized so if the ansible remote_user has its locale set to something other than english or C, instead of having this in the output :
there's this (user with LANG=fr_FR.UTF-8 used as example) :
Id du dépôt : crb
Nom du dépôt : CentOS Stream 9 - CRB
État du dépôt : activé
Révision du dépôt : 9-stream
Dépôt mis à jour: mer. 16 oct. 2024 15:46:24
Paquets du dépôt : 4533
Paquets dispo. : 4530
Taille du dépôt : 40 G
Métalien du dépôt : https://mirrors.centos.org/metalink?repo=centos-crb-9-stream&arch=x86_64&protocol=https,http
Mis à jour : lun. 21 oct. 2024 15:18:24
Baseurl du dépôt : http://mirror.in2p3.fr/pub/linux/centos-stream/9-stream/CRB/x86_64/os/ (94 more)
Expirat° du dépôt : 21600 secondes (dernier : lun. 21 oct. 2024 15:18:24)
Nom de fichier du dépôt : /etc/yum.repos.d/centos.repo
And the regex always fails because there's no Repo-id in the output.
Summary
When executing
dnf_config_manager
with a remote user that has a locale not set to english (tested withLANG=fr_FR.UTF-8
) the module fails withdid not find repo with ID 'xxx' in dnf repolist --all --verbose
.The module uses a regex on the
dnf repolist --all --verbose
command output defined here :community.general/plugins/modules/dnf_config_manager.py
Line 130 in cc72fa0
But the
dnf repolist --all --verbose
command output is localized so if the ansibleremote_user
has its locale set to something other than english or C, instead of having this in the output :there's this (user with
LANG=fr_FR.UTF-8
used as example) :And the regex always fails because there's no
Repo-id
in the output.Issue Type
Bug Report
Component Name
dnf_config_manager
Ansible Version
Community.general Version
Configuration
OS / Environment
Ansible Controller OS : Ubuntu 22.04.5 LTS running in WSL on Windows 11,
ansible
installed from the official PPATarget OS : CentOS Stream 9
Steps to Reproduce
For the target machine :
fr_FR.UTF-8
wheel
groupExample playbook :
Expected Results
The
dnf_config_manager
module should enable the CRB repository.Actual Results
Workaround
I've simply changed the task to force the locale to
en_US.UTF-8
like so:Code of Conduct
The text was updated successfully, but these errors were encountered: