Compare commits

..

No commits in common. "16a7bb915f721125ab3eab47491b32b4a57b96be" and "f6ac34dfd0d51f4144bbd8769beed4a01677518b" have entirely different histories.

3 changed files with 6 additions and 24 deletions

View file

@ -1,15 +1,8 @@
default_locale = node.metadata.get('locale/default')[0] locale = node.metadata.get('locale')
installed_locales = sorted([
node.metadata.get('locale/default'),
*node.metadata.get('locale/installed'),
])
files = { files = {
'/etc/locale.gen': { '/etc/locale.gen': {
'content': '\n'.join( 'content': f"{locale} {locale.split('.')[1]}\n",
f'{locale} {type}' for locale, type in installed_locales
),
'triggers': { 'triggers': {
'action:locale-gen', 'action:locale-gen',
}, },
@ -22,8 +15,8 @@ actions = {
'triggered': True, 'triggered': True,
}, },
'systemd-locale': { 'systemd-locale': {
'command': f'localectl set-locale LANG="{default_locale}"', 'command': f'localectl set-locale LANG="{locale}"',
'unless': f'localectl | grep -Fi "system locale" | grep -Fi "{default_locale}"', 'unless': f'localectl | grep -Fi "system locale" | grep -Fi "{locale}"',
'preceded_by': { 'preceded_by': {
'action:locale-gen', 'action:locale-gen',
}, },

View file

@ -4,16 +4,5 @@ defaults = {
'locales': {}, 'locales': {},
}, },
}, },
'locale': { 'locale': 'en_US.UTF-8',
'default': ('en_US.UTF-8', 'UTF-8'),
'installed': {
('de_AT.UTF-8', 'UTF-8'),
('de_CH.UTF-8', 'UTF-8'),
('de_DE.UTF-8', 'UTF-8'),
('de_LU.UTF-8', 'UTF-8'),
('en_CA.UTF-8', 'UTF-8'),
('en_GB.UTF-8', 'UTF-8'),
('en_US.UTF-8', 'UTF-8'),
},
},
} }

View file

@ -17,5 +17,5 @@ PermitTTY yes
TCPKeepAlive yes TCPKeepAlive yes
ClientAliveInterval 30 ClientAliveInterval 30
ClientAliveCountMax 5 ClientAliveCountMax 5
AcceptEnv LANG AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp /usr/lib/openssh/sftp-server