bundles/basic: don't rewrite /etc/locale.gen every time
This commit is contained in:
parent
56a36f8cae
commit
8dc66421c0
1 changed files with 11 additions and 5 deletions
|
@ -13,14 +13,20 @@ files = {
|
|||
'/etc/htoprc.global': {
|
||||
'source': 'htoprc',
|
||||
},
|
||||
'/etc/locale.gen': {
|
||||
'content_type': 'mako',
|
||||
'/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",
|
||||
'triggers': {
|
||||
'action:locale-gen',
|
||||
},
|
||||
},
|
||||
'/etc/motd': {},
|
||||
'needs': locale_needs,
|
||||
}
|
||||
locale_needs = {f'action:ensure_locale_{locale}_is_enabled'}
|
||||
|
||||
actions = {
|
||||
'locale-gen': {
|
||||
|
|
Loading…
Reference in a new issue