Skip to content

Latest commit

 

History

History
123 lines (83 loc) · 1.92 KB

File metadata and controls

123 lines (83 loc) · 1.92 KB

Ansible Role: systemd_timesyncd

An Ansible role that configures systemd-timesyncd.

Table of Contents

Role Variables

Time Zone

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

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 Packages

Remove legacy timesync packages (ntp, chrony):

systemd_timesyncd_remove_legacy_packages: yes

Dependencies

---

# requirements.yml

collections:

  - name: community.general

  - name: idiv_biodiversity.systemd
    version: X.Y.Z

...

Example Playbook

Top-Level Playbook

Write a top-level playbook:

---

- name: head server
  hosts: head

  roles:
    - role: idiv_biodiversity.systemd.systemd_timesyncd
      tags:
        - systemd
        - systemd-timesyncd

...

Role Dependency

Define the role dependency in meta/main.yml:

---

dependencies:

  - role: idiv_biodiversity.systemd.systemd_timesyncd
    tags:
      - systemd
      - systemd-timesyncd

...