bundlewrap/bundles/systemd/items.py
Franziska Kunsmann 58d99eb402
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/systemd: configure journald
2020-12-12 10:39:57 +01:00

46 lines
1.2 KiB
Python

actions = {
'systemd-reload': {
'command': 'systemctl daemon-reload',
'cascade_skip': False,
'triggered': True,
'needed_by': {
'svc_systemd:',
},
},
'systemd-hostname': {
'command': 'hostnamectl set-hostname {}'.format(node.metadata['hostname']),
'unless': '[ "$(hostnamectl --static)" = "{}" ]'.format(node.metadata['hostname']),
# Provided by 'hostname' bundle
'needs': {
'file:/etc/hosts',
},
},
'systemd-timezone': {
'command': 'timedatectl set-timezone UTC',
'unless': 'timedatectl status | grep -Fi \'time zone\' | grep -i \'utc\'',
},
'systemd-enable-ntp': {
'command': 'timedatectl set-ntp true',
'unless': 'timedatectl status | grep -Fi \'ntp service\' | grep -i \'active\'',
},
}
files = {
'/etc/systemd/journald.conf': {
'content_type': 'mako',
'context': {
'journal': node.metadata.get('systemd', {}).get('journal', {}),
},
'triggers': {
'svc_systemd:systemd-journald:restart',
},
},
}
svc_systemd = {
'systemd-journald': {
'needs': {
'file:/etc/systemd/journald.conf',
},
},
}