| .. | ||
| defaults | ||
| meta | ||
| tasks | ||
| templates | ||
| .ansible-lint | ||
| README.md | ||
chrony
chronyd is a daemon for synchronisation of the system clock. It can synchronise the clock with NTP servers, reference clocks (e.g. a GPS receiver), and manual input using wristwatch and keyboard via chronyc. It can also operate as an NTPv4 (RFC 5905) server and peer to provide a time service to other computers in the network.
Bugs
Not able to set time in rhel8 due to bug in rhel8
Version
4.1.1--- Updated molecule test setup4.1.0--- Add support for RHEL10. The role now supports os_family = redhat4.0.2--- Change test setup to use Ansible Molecule4.0.1--- Allow Fedora CoreOS 41 and remove support for older fedora versions.4.0.0--- Updated for ansible-core 2.16. Removed support for Ubuntu Xenial and Ubuntu Bionic.3.2.0--- Added Ubuntu Noble support3.1.3--- Allow Fedora CoreOS 393.1.2--- fix checkmode3.1.1--- bug fix, ansible-lint3.1.0--- added support for Fedora CoreOS (FCOS 38.x.x.x) but with no tests3.0.1--- bug fix, ansible-lint3.0.0--- updated to ansible version 2.122.3.0--- added RHEL 9 and CentOS Stream 8 support2.2.0--- added configuration options to use role for ntp server configuration, including leap second smearing2.1.0--- add ubuntu jammy and removed centos8 support + rettet noe syntax i meta og template2.0.0--- remove ubuntu xenial support + add rtcsync and allow config1.5.0--- add support for setting timezone1.4.0--- add rhel8 and remove trusty+centos61.3.0--- remove ubuntu precise from testing1.2.1--- fix lint problem1.2.0--- added ubuntu focal, 20.041.1.2--- tested with Ansible 2.9.111.1.1--- prepare for github1.1.0--- ensure NTP traffic on port123, for firewall purposes1.0.2--- removed unsupported directive for v31.0.1--- fixed restart when config changes1.0.0--- initial versionmaster--- latest development version
Requirements
This role supports
- RedHat Based OS, version 8,9,10
- Ubuntu 20.04, 22.04, and 24.04
- CentOS 7
- CentOS Stream 8
- Fedora CoreOS 41
Role Variables
chrony_allow_enable--- enable allow config, defaultfalsechrony_allow--- list of IP addresses/networks allowed to connect to chrony, default [127.0.0.1]chrony_disable_ntpd--- disable the old NTP daemon, defaulttruechrony_enable--- enablechronyNTP daemon, defaulttruechrony_log_enable--- enable logging, defaultfalsechrony_log--- configure logging (requires chrony_logging_enable set to true), defaultmeasurements statistics trackingchrony_logdir--- configure log directory (requires chrony_logging_enable set to true), default/var/log/chrony/chrony_ntp_servers--- list of NTP servers in use, default['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org']chrony_rtcsync--- enable kernel synchronization of the real-time clock (RTC), defaultfalsechrony_smearing--- enable leap second smearing (should only be used for NTP servers), defaultfalsechrony_timezone--- timezone for the system. Runtimedatectl list-timezoneson any systemd system to list available timezones, defaultUTC
Dependencies
None.
Example Playbook
- hosts: servers
roles:
- role: chrony
chrony_allow_enable: true
chrony_allow:
- 10.10.10.0/24
- 127.0.0.1
- ::/0
chrony_disable_ntpd: true
chrony_enable: true
chrony_log_enable: true
chrony_log: measurements statistics tracking
chrony_logdir: /var/log/chrony/
chrony_ntp_servers:
- 0.ubuntu.pool.ntp.org
- 1.ubuntu.pool.ntp.org
- 2.ubuntu.pool.ntp.org
- 3.ubuntu.pool.ntp.org
chrony_rtcsync: true
chrony_smearing: true
chrony_timezone: "Europe/Oslo"
Testing
Testing is done using Ansible Molecule. It uses our libvirt-provision role as backend.
Testing is done Almalinux, and Ubuntu.
To run test:
molecule test
To run test step by step run:
molecule create
molecule converge
molecule idempotence
molecule verify
molecule destroy
License
GPLv2
Author Information
Created 2020 by IT Infrastructure at MET Norway Contactpoint: IT Infrastructure Basis Team