bundlewrap/bundles/systemd/items.py
Franziska Kunsmann 6ba0f6df1d
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/systemd: make sure we're using UTC and NTP
2020-11-13 23:26:13 +01:00

26 lines
858 B
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\'',
},
}