An Ansible role that configures systemd-timesyncd.
Set the system time zone. There is no default. The prefix is system_
on
purpose, so this variable can be used across different roles that also set the
time zone.
systemd_timesyncd_timezone: Europe/Berlin
NTP servers are the preferred servers. They should be set to your networks internal NTP servers.
systemd_timesyncd_ntp_servers:
- ntp1.domain.org
- ntp2.domain.org
- ntp3.domain.org
Use regional pools for fallback servers:
systemd_timesyncd_ntp_fallback_servers:
- 0.europe.pool.ntp.org
- 1.europe.pool.ntp.org
- 2.europe.pool.ntp.org
- 3.europe.pool.ntp.org
Remove legacy timesync packages (ntp, chrony):
systemd_timesyncd_remove_legacy_packages: yes
---
# requirements.yml
collections:
- name: community.general
- name: idiv_biodiversity.systemd
version: X.Y.Z
...
Write a top-level playbook:
---
- name: head server
hosts: head
roles:
- role: idiv_biodiversity.systemd.systemd_timesyncd
tags:
- systemd
- systemd-timesyncd
...
Define the role dependency in meta/main.yml
:
---
dependencies:
- role: idiv_biodiversity.systemd.systemd_timesyncd
tags:
- systemd
- systemd-timesyncd
...