Keep the clock on systemd-timesyncd and the timezone on UTC in the common role
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
- import_tasks: ./packages.yml
|
- import_tasks: ./packages.yml
|
||||||
|
|
||||||
|
- import_tasks: ./timesync.yml
|
||||||
|
|
||||||
- import_tasks: ./aliases.yml
|
- import_tasks: ./aliases.yml
|
||||||
|
|
||||||
- import_tasks: ./networking.yml
|
- import_tasks: ./networking.yml
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user