bundles/basic: ensure a proper locale is installed
This commit is contained in:
parent
a160e7cf46
commit
4a9463db5f
9 changed files with 34 additions and 10 deletions
1
bundles/basic/files/locale
Normal file
1
bundles/basic/files/locale
Normal file
|
@ -0,0 +1 @@
|
|||
LANG=${node.metadata['locale']}
|
1
bundles/basic/files/locale.gen
Normal file
1
bundles/basic/files/locale.gen
Normal file
|
@ -0,0 +1 @@
|
|||
${node.metadata['locale']}
|
27
bundles/basic/items.py
Normal file
27
bundles/basic/items.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# TODO support non-systemd systems
|
||||
|
||||
files = {
|
||||
'/etc/default/locale': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'action:locale-gen',
|
||||
},
|
||||
},
|
||||
'/etc/hosts': {
|
||||
'content_type': 'mako',
|
||||
},
|
||||
'/etc/locale.gen': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'action:locale-gen',
|
||||
},
|
||||
},
|
||||
'/etc/motd': {},
|
||||
}
|
||||
|
||||
actions = {
|
||||
'locale-gen': {
|
||||
'triggered': True,
|
||||
'command': 'locale-gen',
|
||||
},
|
||||
}
|
3
bundles/basic/metadata.py
Normal file
3
bundles/basic/metadata.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
defaults = {
|
||||
'locale': 'en_US.UTF-8',
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
# TODO support non-systemd systems
|
||||
|
||||
files = {
|
||||
'/etc/hosts': {
|
||||
'content_type': 'mako',
|
||||
},
|
||||
'/etc/motd': {},
|
||||
}
|
|
@ -10,7 +10,7 @@ actions = {
|
|||
'systemd-hostname': {
|
||||
'command': 'hostnamectl set-hostname {}'.format(node.metadata['hostname']),
|
||||
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(node.metadata['hostname']),
|
||||
# Provided by 'hostname' bundle
|
||||
# Provided by bundle:basic
|
||||
'needs': {
|
||||
'file:/etc/hosts',
|
||||
},
|
||||
|
|
|
@ -19,8 +19,8 @@ groups['linux'] = {
|
|||
'bundles': {
|
||||
'apt',
|
||||
'backup-client',
|
||||
'basic',
|
||||
'cron',
|
||||
'hostname',
|
||||
'openssh',
|
||||
'postfix',
|
||||
'sshmon',
|
||||
|
|
Loading…
Reference in a new issue