wip
This commit is contained in:
parent
968f5e8d7d
commit
e26b259009
3 changed files with 36 additions and 0 deletions
27
bundles/locale/items.py
Normal file
27
bundles/locale/items.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
locale = node.metadata.get('locale')
|
||||||
|
|
||||||
|
files = {
|
||||||
|
'/etc/locale.gen': {
|
||||||
|
'content': f"{locale} {locale.split('.')[1]}\n",
|
||||||
|
'triggers': {
|
||||||
|
'action:locale-gen',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
actions = {
|
||||||
|
'locale-gen': {
|
||||||
|
'command': 'locale-gen',
|
||||||
|
'triggered': True,
|
||||||
|
},
|
||||||
|
'systemd-locale': {
|
||||||
|
'command': f'localectl set-locale LANG="{locale}"',
|
||||||
|
'unless': f'localectl | grep -Fi "system locale" | grep -Fi "{locale}"',
|
||||||
|
'preceded_by': {
|
||||||
|
'action:locale-gen',
|
||||||
|
},
|
||||||
|
'needs': {
|
||||||
|
'action:locale-gen',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
8
bundles/locale/metadata.py
Normal file
8
bundles/locale/metadata.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
defaults = {
|
||||||
|
'apt': {
|
||||||
|
'packages': {
|
||||||
|
'locales': {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'locale': 'en_US.UTF-8',
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
'bundles': [
|
'bundles': [
|
||||||
'hostname',
|
'hostname',
|
||||||
'hosts',
|
'hosts',
|
||||||
|
'locale',
|
||||||
'network',
|
'network',
|
||||||
'ssh',
|
'ssh',
|
||||||
'systemd',
|
'systemd',
|
||||||
|
|
Loading…
Reference in a new issue