From fbf0371371c18fb69cb8a9b8b243fe4cf764e667 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Thu, 18 Feb 2021 17:56:06 +0100 Subject: [PATCH] bundles/systemd: support different timezones --- bundles/systemd/items.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/systemd/items.py b/bundles/systemd/items.py index 0365bce..6e587dc 100644 --- a/bundles/systemd/items.py +++ b/bundles/systemd/items.py @@ -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',