Installs and configures chrony NTP client/server.
- Description
- Setup - The basics of getting started with chrony
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module sets up the chrony NTP client/server on the system.
Module development has been based on chrony versions 3.2 - 3.5.
- Installs chrony package(s).
- Sets up the chrony configuration file from provided data, or using OS default data bundled with module.
- Sets up the chrony keyfile from provided data.
- Manages the chrony service.
- Supported OS with chrony package available in a configured package repository.
- puppetlabs/stdlib module.
To install and configure chrony as a client with OS default settings, simply define the class.
class { 'chrony': }
class { 'chrony': }
class { 'chrony':
servers => [
{ hostname => 'ntp1.mydomain.tld' },
{ hostname => 'ntp2.mydomain.tld' }
]
}
class { 'chrony':
access_rules => [
{
access => 'allow',
subnet => '192.168.1'
}
]
}
Example using three pool.ntp.org servers as sources, while serving time to the 192.168.0.0/16 network - except for 192.168.2.0/24.
class { 'chrony':
servers => [
{
hostname => '0.pool.ntp.org',
iburst => true,
},
{
hostname => '1.pool.ntp.org',
iburst => true,
},
{
hostname => '2.pool.ntp.org',
iburst => true,
},
],
access_rules => [
{
access => 'deny',
subnet => '192.168.2.',
},
{
access => 'allow',
subnet => '192.168.',
}
],
}
chrony::servers:
- hostname: '0.pool.ntp.org'
iburst: true
- hostname: '1.pool.ntp.org'
iburst: true
- hostname: '2.pool.ntp.org'
iburst: true
chrony::access_rules:
- access: 'deny'
subnet: '192.168.2.'
- access: 'allow'
subnet: '192.168.'
include chrony
class { 'chrony':
servers => [
{
hostname => 'ntp1.mydomain.tld',
key => 5,
}
],
keys => [
{
id => 5,
hashalg => 'SHA1',
hash => 'HEX:EC56E6FC27CD0C9B5E6B867DD53F137985279B48',
}
],
}
Tested on CentOS 7 and 8, Debian 9 and 10, and Ubuntu 18.04 aswell as 20.04.
All bugreports, suggestions and patches will be considered.