Frzk.chrony

Ansible Role: chrony

This Ansible role lets you install chrony and manage its settings.

A special systemd unit file is created for Debian version 11 and above, and Arch Linux.

For more details on chrony, visit the official project page.

Requirements

None

Dependencies

None

Role variables

Variable name Description Default value
chrony_service_name The name of the service. chronyd
chrony_ntp_pools A list of NTP pools to use and their options. [ 'pool.ntp.org iburst maxpoll 10' ]
chrony_ntp_servers A list of NTP servers to use and their options. []
chrony_ntp_peers A list of NTP peers to use and their options. []
chrony_config_file The location of the chrony configuration file. /etc/chrony.conf
chrony_config_logdir The location of the chrony logs directory. /var/log/chrony
chrony_config_driftfile The location of the chrony drift file. /var/lib/chrony/drift
chrony_makestep_threshold The time (in seconds) beyond which chrony will step the clock instead of adjusting it gradually. 1
chrony_makestep_limit The limit (in number) beyond which chrony will no longer step the clock, even if needed. 10
chrony_allow A list of allowed subnets that can access this machine as an NTP server. []
chrony_deny A list of disallowed subnets that cannot access this machine as an NTP server. []

:green_book: Documentation:

Example

Here’s a simple example playbook.

IMPORTANT: DO NOT use this example directly.

---
- hosts: all
  become: true
  roles:
    - role: frzk.chrony
      chrony_service_name: chronyd
      chrony_ntp_pools: []
      chrony_ntp_servers:
        - 0.rhel.pool.ntp.org iburst maxpoll 10
        - 1.rhel.pool.ntp.org iburst maxpoll 10
        - 2.rhel.pool.ntp.org iburst maxpoll 10
        - 3.rhel.pool.ntp.org iburst maxpoll 10
      chrony_ntp_peers:
        - ntp00.example.com maxpoll 10
        - ntp01.example.com maxpoll 10
        - ntp02.example.com maxpoll 10
      chrony_config_file: /etc/chrony.conf
      chrony_config_driftfile: /var/lib/chrony/drift
      chrony_makestep_threshold: 5
      chrony_makestep_limit: 3
      chrony_allow:
        - 192.0.2.0/24
        - 192.0.2.200
      chrony_deny:
        - 192.0.2.0/25
...

Testing

Testing is done using Molecule and Ansible with GitHub Actions and Docker containers.

Successful tests occur on:

  • Arch Linux
  • Debian 11
  • Debian 10
  • Debian 9
  • Ubuntu 20.04
  • Ubuntu 18.04

Contributing

Feedback, patches, comments, bug reports, and feature requests are welcome. Please refer to the Contributing Guide for more details.

Informazioni sul progetto

Install, configure and enable chrony.

Installa
ansible-galaxy install Frzk.chrony
Licenza
apache-2.0
Download
11.9k
Proprietario