Skip to content

shalomb/ansible-systemd-timesyncd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Role Name

Ansible role to configure the systemd-timesyncd service setting S/NTP and timezone parameters.

Requirements

  • systemd >= 2.9
  • systemd-timesyncd.service unit
  • dbus

Role Variables

config:
  timezone: 'Africa/Libreville'
  ntp_servers:
    - 0.pool.ntp.org
    - 1.pool.ntp.org
    - 2.pool.ntp.org
    - 3.pool.ntp.org
  root_distance_max_sec: 5
  poll_interval_max_sec: 2048
  poll_interval_min_sec: 32

Also see defaults/main.yml for more information on these parameters.

Dependencies

  • Debian-based running systemd-timesyncd (NOTE: systemd on the Redhat family (RHEL/Fedora/CentOs) is not compiled with timesyncd for NTP synchronization and uses chrony instead)

Conflicts

This role will likely fail to succeed in configuring timesyncd if the following services are enabled/running on the system.

  • ntp/ntpd - reference implementation
  • chrony/chronyd

Example Playbook

- name: TC2 - Run ansible-systemd-timesyncd role
  hosts: localhost
  remote_user: root
  roles:
  - role: ansible-systemd-timesyncd
    config:
      timezone: 'Africa/Libreville'

Also see tests/ for how tests are run.

References

License

Apache License, v2.0

Author Information

Shalom Bhooshi