Keep the clock on systemd-timesyncd and the timezone on UTC in the common role

This commit is contained in:
2026-10-07 21:22:01 +00:00
parent 5da89fdf29
commit a9a60e3106
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# Containers share the host kernel clock and cannot discipline it themselves.
- name: Configure time synchronisation
when: ansible_facts['virtualization_role'] != 'guest' or ansible_facts['virtualization_type'] not in ['lxc', 'docker', 'podman', 'container']
block:
- name: Install systemd-timesyncd
package:
name: systemd-timesyncd
state: present
- name: Enable systemd-timesyncd
systemd:
name: systemd-timesyncd
enabled: yes
state: started
# Logs and local-time timers line up across hosts.
- name: Set the timezone to UTC
community.general.timezone:
name: Etc/UTC