feat(sysadmin-tools): generate only en and it locales #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/sysadmin-locale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Hosts keep whatever locales their installer or image left in
/etc/locale.gen, solocale-genis slow on some and the archiveholds locales nobody uses, while the default language differs from host
to host. The fleet needs English, with Italian as the fallback.
What changed
fortify.yml,sysadmin-toolswrites/etc/locale.genwhole withen_US.UTF-8,en_GB.UTF-8andit_IT.UTF-8, installinglocalesif needed, andruns
locale-genat once when the file changed, which drops everyother generated locale.
/etc/default/localesetsLANG=en_US.UTF-8andLANGUAGE=en_US:en:it_IT:it.sysadmin_locales,sysadmin_locale_langandsysadmin_locale_language; see the role README.sysadmin-toolsgains its first molecule scenario, inMOLECULE_ROLES.Out of scope: removing
locales-all, and dpkgpath-excluderules fortranslations and man pages.
How to verify
./tests/molecule/run.sh roles/sysadmin-tools: the scenariogenerates
de_DE.UTF-8first, then assertslocale -alists onlyC,C.utf8,POSIXand the three locales, checks/etc/default/locale, and passes idempotence.make verify(check and everyscenario, with podman) exit 0, no
^ERRORin any molecule log; thesame scenario on main's code fails at "Assert only English and
Italian are generated", with
de_DE.utf8left.ansible-playbook fortify.yml -i inventory/<tenant>/ --tags sysadmin-tools --check --diff.Considerations
user, service or SSH client forwarding one gets "cannot change locale"
warnings and falls back to
C; services switch to English when theystart after systemd re-reads
/etc/default/locale, at the latestafter the next boot. SSH, the firewall and the network are untouched,
so nothing can be locked out.
locale-genalso generates what language packs list in/var/lib/locales/supported.d; a host withlocales-allkeeps everyprebuilt locale. Both are documented, not handled.
sysadmin_localesentryand the ARCHITECTURE row reads loosely given those two exceptions, and
a few README wording and wrap nits.