-
Notifications
You must be signed in to change notification settings - Fork 55
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
Does not add/remove locales on Centos #48
Comments
Can you elaborate a little bit more on that? |
I have 3 installed locales in the system: C, POSIX, and en_US.UTF-8.
and fr_CH.UTF-8 was marked as default, but unfortunately it have not been, and was not installed. |
This is because of no |
On CentOS you could use |
glibc-common (on EL7) runs On one of my servers installed more minimally (not by me), the file
(Note colon separated list.) After an update glibc, the old locales will be removed, and only those locales will be regenerated. A different filename can be used, but I think it is good enough/better to handle this situation. The current value can be checked with the command |
Useful info here: http://blog.nashcom.de/nashcomblog.nsf/dx/locale-issue-on-linux-centos-rhel.htm [root@test-centos8 ~]# rpm -q --scripts glibc-minimal-langpack
[root@test-centos8 ~]# rpm --eval "%{_install_langs}"
all
[root@test-centos8 ~]# locale -a
C
C.utf8
POSIX So .. in EL8, this stuff with the RPM macro is only needed for the package containing all locales. If you install
For EL7, messing with the rpm macro is probably required. |
This is my quick-fix. I use an exec so I can avoid making the rpm-macro file if there isn't one already, meaning the "all" behaviour is preserved rather than restricted to the list in Don't really know how to do this cleanly in the module itself. if $::osfamily == 'RedHat' and versioncmp($::operatingsystemrelease, '8.0') < 0 {
# A bit of an ugly hack needed on EL7 where there is no separate
# glibc-langpack-en. By default, this RPM macro expands to
# 'all', which means all locales are generated. On a minimal
# install, it is set to only include C and en_US, and we want
# en_IE.utf8 to get 24 hour time from date etc. On EL8 we use
# C.utf8, which is part of the minimal install, but this is
# unsupported on EL7.
#
# See also https://github.com/saz/puppet-locales/issues/48
Exec { path => '/usr/bin:/bin' }
exec { 'Update rpm macro _install_langs':
environment => [
inline_template('VALUE=%_install_langs <%= @locales.map { |l| l.split(/[. ]/)[0] }.uniq.join(":") %>'),
'FILE=/etc/rpm/macros.langs',
],
command => "sh -c 'echo \$VALUE > \$FILE'",
onlyif => "sh -c '[ -f \$FILE ] && ! grep -q -x \"\$VALUE\" \$FILE'"
}
~> exec { 'reinstall glibc-common':
command => 'yum -y reinstall glibc-common',
refreshonly => true,
}
} |
As there's no activity on this issue for a longer time, I'll close it. If you think it's still relevant, please let me know. |
EL7 has not changed behaviour in the interim, and EL7 is still listed as supported by the module, so I am a bit confused why you closed it. You don't really want "any progress?" comments to keep the issue active, do you? |
It's fine for me to keep the issue open, but I'm not working with EL7 and not able to come up with a proper fix. I'm happy for any PR which can be merged, but at the same time, I'm not expecting much progress here. Nobody came up with a PR since 2020, that's why I thought it's just stale. And, honestly, I'm not tracking the EOL date of EL7. So, yes, sometimes a "any progress?" can be helpful. |
Class is changing default locale config but does not check if locale is present/generated in the system.
The text was updated successfully, but these errors were encountered: