2021-01-23 11:05:59 +00:00
|
|
|
# TODO support non-systemd systems
|
|
|
|
|
|
|
|
files = {
|
|
|
|
'/etc/default/locale': {
|
2021-02-18 13:51:33 +00:00
|
|
|
'content_type': 'mako',
|
2021-01-24 06:49:49 +00:00
|
|
|
'needs': {
|
2021-01-23 11:05:59 +00:00
|
|
|
'action:locale-gen',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'/etc/hosts': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
},
|
2021-02-24 18:24:56 +00:00
|
|
|
'/etc/htoprc.global': {
|
|
|
|
'source': 'htoprc',
|
|
|
|
},
|
2021-05-23 12:53:45 +00:00
|
|
|
'/etc/motd': {},
|
|
|
|
}
|
|
|
|
|
|
|
|
locale_needs = set()
|
|
|
|
for locale in sorted(node.metadata['locale']['installed']):
|
|
|
|
actions[f'ensure_locale_{locale}_is_enabled'] = {
|
|
|
|
'command': f"sed -i '/{locale}/s/^# *//g' /etc/locale.gen",
|
|
|
|
'unless': f"grep -e '^{locale}' /etc/locale.gen",
|
2021-01-23 11:05:59 +00:00
|
|
|
'triggers': {
|
|
|
|
'action:locale-gen',
|
|
|
|
},
|
2021-05-23 12:53:45 +00:00
|
|
|
'needs': locale_needs,
|
|
|
|
}
|
|
|
|
locale_needs = {f'action:ensure_locale_{locale}_is_enabled'}
|
2021-01-23 11:05:59 +00:00
|
|
|
|
|
|
|
actions = {
|
|
|
|
'locale-gen': {
|
|
|
|
'triggered': True,
|
|
|
|
'command': 'locale-gen',
|
|
|
|
},
|
|
|
|
}
|