bundles/systemd: support different timezones

This commit is contained in:
Franzi 2021-02-18 17:56:06 +01:00
parent dba7beae1c
commit fbf0371371
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -1,3 +1,5 @@
timezone = node.metadata.get('timezone', 'UTC')
actions = {
'systemd-reload': {
'command': 'systemctl daemon-reload',
@ -16,8 +18,8 @@ actions = {
},
},
'systemd-timezone': {
'command': 'timedatectl set-timezone UTC',
'unless': 'timedatectl status | grep -Fi \'time zone\' | grep -i \'utc\'',
'command': 'timedatectl set-timezone {}'.format(timezone),
'unless': 'timedatectl status | grep -Fi \'time zone\' | grep -i \'{}\''.format(timezone.lower()),
},
'systemd-enable-ntp': {
'command': 'timedatectl set-ntp true',