Closed ebgp closed 1 month ago
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.
@ebgp Thanks for reporting this issue. We already reset locale
to best guess locale.
Could you please provide me with additional steps to reproduce it? Thanks.
Since GNU gettext prefers LANGUAGE in some situations https://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html, https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html, anywhere parsing CLI output that uses gettext may need LANGUAGE set too. It looks like apt_key
, apt_repository
, and dpkg_selections
have the same issue.
Summary
With Ubuntu 24.04LTS system locale set as LANGUAGE="en_GB:" the behaviour of ansible.builtin.apt is to always report 'changed' as 'true' when parsing the output of an apt-get upgrade.
A workaround, to avoid the 'translated' output, is to unset the LANGUAGE system locale variable, but it may be preferable to have ansible unset LANGUAGE prior to performing apt-get operations.
The difference in behaviour with and without LANGUAGE set is due to the following substitutions with en_GB contained in the language-pack-en-base package : msgid "%lu upgraded, %lu newly installed, " msgstr "%lu to upgrade, %lu to newly install, "
Issue Type
Bug Report
Component Name
ansible.builtin.apt
Ansible Version
Configuration
OS / Environment
Ubuntu 24.04LTS LANGUAGE="en_GB:"
Steps to Reproduce
Expected Results
"changed": false, "msg": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nCalculating upgrade...\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n"
Actual Results
Code of Conduct