system_locale
Maintains the ansible/roles/system_locale Ansible role that sets LANG in /etc/locale.conf on RHEL-family systems, restricted to C.UTF-8, en_US.UTF-8, or auto, as part of the Linux SOE. Rebuilds the in
Files1
View on GitHubSKILL.md.claude/skills/system_locale/SKILL.md
GitHubsystem_locale
Maintains ansible/roles/system_locale/. See docs/ARCHITECTURE.md for
the shared conventions.
ansible/roles/system_locale/README.md documents this role's full
configuration surface (every defaults/main.yml variable, with its
original inline comments, rendered as a single reference). Read it
before proposing or explaining how to configure this role — it
reflects the role's actual current defaults even if a variable summary
elsewhere in this file has drifted out of sync with the role.
Policy & workload awareness
docs/VERTICAL_POLICY.md, docs/HORIZONTAL_POLICY and docs/WORKLOAD.md capture org-wide policy items and
the workloads this SOE actually hosts — either can gain a new or changed
item that this role should reflect. Before auditing, remediating, or
proposing a change, check whether either doc has changed more recently
than this role's own code:
git log -1 --format='%cI %h %s' -- docs/VERTICAL_POLICY.md docs/HORIZONTAL_POLICY.md docs/WORKLOAD.md
git log -1 --format='%cI %h %s' -- ansible/roles/system_locale/
If the docs' latest commit is newer than the role's, this role hasn't been re-assessed against current policy/workload — read both files and judge whether anything added or changed since is relevant to this domain:
- Relevant — propose a concrete change on a branch
(
soe/system_locale/policy-<short-desc>orsoe/system_locale/workload-<short-desc>), same branch + PR workflow as any other role change (see "What to do" above anddocs/ARCHITECTURE.md's "Contribution workflow"). Don't wait to be asked. - Not relevant — say so explicitly (e.g. "checked against
docs/VERTICAL_POLICY.md,docs/HORIZONTAL_POLICYanddocs/WORKLOAD.mdas of<date>, nothing affecting this domain") rather than silently skipping the check.
This check is informational, not a gate — it runs alongside a normal audit/remediate, never blocks one; surface the staleness note alongside the normal output.
What the role actually does
Encoded in ansible/roles/system_locale/defaults/main.yml:
system_locale(defaultauto): onlyC.UTF-8,en_US.UTF-8, orautoare accepted — anything else fails the play immediately via an explicitansible.builtin.failtask, not anassert.autoresolves toC.UTF-8on RHEL 9+ (glibc ships it natively there) oren_US.UTF-8on RHEL 8.- Installs
glibc-minimal-langpack, plusglibc-langpack-enif the resolved target isen_US.UTF-8(either chosen directly, or viaautoon RHEL 8). - Rewrites
LANG=in/etc/locale.confviareplace. - If that changed, rebuilds the initramfs (
dracut -f --regenerate-all). - If
system_locale_reboot: true(the default) and the locale changed, reboots the host — same pattern asboot_parameters, no separate confirmation gate inside the role.
What to do
Audit: ansible-playbook ansible/configure_rhel.yml --tags system_locale --check --diff
Remediate: same command without --check. Because
system_locale_reboot defaults to true, a remediate run that actually
changes the locale reboots the host — get explicit confirmation
first, and consider -e system_locale_reboot=false if the user wants the
/etc/locale.conf change applied now but the reboot deferred.
Propose a change to the role itself (e.g. supporting an additional
locale): never commit directly. On a branch named
soe/system_locale/<short-desc>, edit the role, validate locally
(--syntax-check, ansible-lint roles/system_locale/, --check --diff),
push, and open a PR titled [system_locale] <what changed> with the
--check --diff output in the body — then stop for human review. See
docs/ARCHITECTURE.md's "Contribution workflow".
Notes
- The role only ever supports exactly three values for
system_locale— it isn't a general-purpose "set any locale" role. Extending it to a different language/locale is a role change (new package logic, new accepted value), not a variable override. - Unlike
system_keyboard, there's nolocalectl-based read here — the current locale is read straight from/etc/locale.conf. - If the target locale package isn't installable (bad repo config,
offline host), the
dnftask fails loudly rather than silently leaving the old locale in place — that's expected, not a role bug to work around.