Forge Home

chrony

Installs and configures the chrony service.

8,922 downloads

6,439 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.2.4 (latest)
  • 0.2.3
  • 0.2.2
  • 0.2.1
released Dec 13th 2018
This version is compatible with:
  • , , , , , , , Gentoo

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'blackknight36-chrony', '0.2.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add blackknight36-chrony
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install blackknight36-chrony --version 0.2.4

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

blackknight36/chrony — version 0.2.4 Dec 13th 2018

chrony

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with chrony
  4. Usage - Configuration options and additional functionality
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

This module manages the chrony NTP client/server daemon. It is capable of trivial NTP client-only setups all the way up to stratum 1 servers connected to reference clocks.

Module Description

The chrony module configures chronyd to act as an NTP client, server, or both. It also can install or remove the chrony package, and enable or disable the chrony service.

Setup

What chrony affects

  • Installs and removes the chrony package
  • Starts and stops the chrony service
  • Manages /etc/chrony/chrony.conf or /etc/chrony.conf
  • Manages /var/lib/chrony
  • Manages /var/log/chrony

Setup Requirements

On most systems, chrony has no special requirements.

On Enterprise Linux 6 or older systems, the EPEL repository is required. I recommend using the stahnma/epel module as this is the official module from the EPEL package maintainer. EPEL is not required on Enterprise Linux 7.

Beginning with chrony

The very basic steps needed for a user to get the module up and running.

The minimum you need to begin using chrony as an NTP client to public NTP servers is something like:

class profile::ntp_client {
    class { '::chrony': }
}

The minimum you need to serve NTP to your local network is:

class profile::ntp_server {
    class { '::chrony':
        client_allow => '192.168.0.0/16',
        serve_ntp    => true,
    }
}

Usage

This module provides a chrony class which accepts the following parameters.

General parameters

[bindcmdaddress]

Restrict the network interface to which chronyd will listen for command packets (issued by chronyc).

Default: [ '127.0.0.1', '::1' ]

[rtconutc]

Whether the computer's onboard real-time clock is set to UTC. Set to false if the RTC is in local time, such as a system which boots multiple operating systems.

Default: true

[sync_local_clock]

Keep the computer's hardware clock in sync.

Default: true

NTP client parameters

[offline]

Whether the NTP client should start in offline mode. In this mode, clients must issue the chronyc online command to begin synchronization (though most systems with a GUI will manage to do this automatically). Useful for laptops and other intermittently connected devices.

Default: false

[servers]

A list of NTP servers and options for those servers. (It is not necessary to specify the offline option; this can be done with the offline parameter.)

Default: Array of public NTP servers, depending on $::osfamily

[source_port]

Select a fixed source port for outgoing NTP packets. By default, the source port is dynamically assigned by the operating system.

Default: undef

NTP server parameters

[client_allow]

Designate subnets from which NTP clients are allowed to access the computer as an NTP server. IPv4 and IPv6 CIDR ranges can be specified.

Default: []

[client_deny]

Designate subnets within previously allowed subnets which are denied to access the NTP server. IPv4 and IPv6 CIDR ranges can be specified.

Default: []

[client_log]

Whether to log statistics about NTP clients.

Default: false

[refclock]

Specify one or more reference clocks to which chrony should obtain time information to act as a stratum 1 server. See the chrony documentation for details.

Default: []

[serve_ntp]

Whether to enable the NTP server functionality. If disabled, chrony will act only as an NTP client.

Default: false

[udlc]

Allow the server to operate without synchronization to an external time source (undisciplined local clock).

Default: false

Limitations

This module currently only works with Debian, Redhat, Arch Linux, and Gentoo based systems. Testing has been done on the following platforms.

  • Debian (6/squeeze, 7/wheezy)
  • Ubuntu (10.04, 12.04, 14.04)
  • CentOS/RHEL (6, 7)
  • Fedora (19-29)
  • Arch Linux (3.16.1)
  • Gentoo (Base System 2.2)

Development

This module is by no means complete. Pull requests are welcome for:

  • Bug fixes
  • Additional operating system support
  • Additional chrony feature support
  • Anything else that makes sense