-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
locale_gen: de_CH.UTF-8 not being created on Ubuntu 24.04 #9131
Comments
Files identified in the description: If these files are incorrect, please update the |
Hi @ltog thanks for reporting. I am trying to reproduce the error, but I do see the locale added when running in Ubuntu 24.04. The only thing I noticed is that the actual locale installed gets a slightly different name, it becomes There are many locales that are named differently when installed. To the best of my knowledge that is inherent to the locale system and that's exactly how it should work. |
@russoz : Thanks for having a look! How did you check the installation of the locale? |
@ltog I was adding an extra case to the test integrations. Running them with
|
hi @ltog: just a friendly check, any chance you had time to take a look at this? |
@russoz : Yeah, I had another look but unfortunately the result is still the same as described above. I know about the different names for the locale but neither is showing up with Would you mind checking whether |
@ltog bingo! The
while provisioning the machine/container. I'll dig more on this. |
@russoz : Great, we have a trail! Keep me posted. |
Will do but, I got a string of busy days ahead of me, I am probably working on this again by the end of next week |
@russoz : Ok, thanks for working on it! |
Hi @ltog @lukasz-zaroda, I did not have time for implementing a solution, but I managed to get the investigation going. Bottom line seems to be the fact that there are two different mechanisms to generate locales, the standard glibc one and the Debian one. The Ubuntu has used both mechanisms for a long time, but starting in Ubuntu 16.04 they seem to have made a decision to let go of the Debian mechanism and use only glibc as the primary mechanism. I imagine/suppose that the tools still provide support for the Debian mechanism - but not sure, nor how long that's gonna last. To the best of my knowledge, both mechanisms claim to take the list of available locales from My intended approach on this is to rewrite the module with the following logic:
That way we are going to have glibc mode as the default, covering virtually most of the cases, and Debian mode for Ubuntu backward compatibility or Debian compatibility (Debian still uses that up to this day, according to ChatGPT :-) - I will test that eventually but not a priority for now). The output variables should not be affected by this - though later on I would want to rename the return value So, I am planning on starting this work slowly in the next couple of days, to give you guys time to read, ponder and comment on it as you see fit. I reckon by the next weekend I should have time to wrap it up and submit the PR. Please let me know what you think. Mentioning #8487 so anyone tracking that one gets notified. Cc: @felixfontein (for your sharp eyes ;-) ) |
Sorry, missed @samikhelil83 on the comment above. |
@ltog @lukasz-zaroda could you please give it a try with the code from the PR? The code for That points to removing |
My guess is that it does work with very old versions of Ubuntu. Since someone might still use the module successfully with these, we should deprecate it. |
OK, just a couple of comments:
Does that look good to you? |
@russoz : Thanks for working on this. I did some tests.
|
hi @ltog , thanks for that! :-) Well, about the versions, my plan is to deprecate support to anything that is not in the CI pipeline, so that should be OK. About the check mode, I would rather do that in a separate PR, because it would be a bugfix and those are backported to previous releases. |
Summary
I try to use the Ansible module
locale_gen
to create the localede_CH.UTF-8
on Ubuntu 24.04 by this task:The task returns OK on both the first and subsequent runs, however, every run takes approx. 23s on a local VM on modern hardware, indicating that compilation is taking place for each run. Worse, the outputs of all of the following commands lack the desired locale, implying that it was not successfully built:
locale -a
localedef --list-archive
localectl list-locales
Expected result: The de_CH.UTF-8 locale showing up in the output of all of these commands.
For testing I use molecule in combination with https://portal.cloud.hashicorp.com/vagrant/discover/alvistack/ubuntu-24.04 on one hand and a custom virtual machine on the other hand. Both show the same symptoms.
From the module output I can see that
ubuntu_mode
is true. That makes sense since/var/lib/locales/supported.d/
is present on both virtual machines. Looking at the source it seems that inapply_change_ubuntu()
eitherset_locale()
should be called (as being done inapply_change
) or the compilation of the locale should be triggered by a corresponding entryde_CH.UTF-8 UTF-8
in file/var/lib/locales/supported.d/local
, neither is being done. To my understanding the comment incommunity.general/plugins/modules/locale_gen.py
Line 217 in bafb8ac
As a workaround I install the apt package
language-pack-de
which creates the desired locale, but results in the creation of other locales as well.Issue Type
Bug Report
Component Name
locale_gen
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Target OS: Ubuntu 24.04.1 LTS
Steps to Reproduce
Expected Results
Locale is being generated.
Actual Results
Locale is not being generated.
Code of Conduct
The text was updated successfully, but these errors were encountered: