Classes
chrony
: Installs and configures the chrony NTP daemon.
Installs and configures the chrony NTP daemon.
class { 'chrony': }
class { 'chrony':
servers => [
{ hostname => 'ntp1.mydomain.tld' },
{ hostname => 'ntp2.mydomain.tld' }
]
}
class { 'chrony':
access_rules => [
{
access => 'allow',
subnet => '192.168.1'
}
]
}
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',
}
],
}
The following parameters are available in the chrony
class.
Data type: Enum['absent', 'present']
What state to ensure the chrony package is in. Default value: 'present'.
Data type: Stdlib::Ensure::Service
What state to ensure the chrony service is in. Default value: 'running'.
Data type: Boolean
Whether or not the chrony service should be automatically started on system boot. Default value: true.
Data type: Stdlib::Absolutepath
The complete path to the chrony configuration file.
Data type: String
Name of the chrony package to install.
Data type: String
Name of the chrony service on the system.
Data type: String
Name of chrony group on the system, used for setting ownership on keyfile.
Data type: Optional[Array[Struct[{ hostname => String, iburst => Optional[Boolean], offline => Optional[Boolean], auto_offline => Optional[Boolean], prefer => Optional[Boolean], noselect => Optional[Boolean], trust => Optional[Boolean], require => Optional[Boolean], xleave => Optional[Boolean], minpoll => Optional[Integer[-6, 24]], maxpoll => Optional[Integer[-6, 24]], key => Optional[Integer], maxdelay => Optional[Variant[Float[0.0, 1000],Integer[0, 1000]]], maxdelayratio => Optional[Variant[Float,Integer]], maxdelaydevratio => Optional[Variant[Float,Integer]], mindelay => Optional[Variant[Float,Integer]], asymmetry => Optional[Variant[Float,Integer]], offset => Optional[Variant[Float,Integer]], minsamples => Optional[Integer], maxsamples => Optional[Integer], polltarget => Optional[Integer[6, 60]], port => Optional[Stdlib::Port], presend => Optional[Integer], minstratum => Optional[Integer], version => Optional[Integer], burst => Optional[Boolean], }]]]
Array of NTP servers to configure as sources.
Data type: Optional[Array[Struct[{ hostname => String, iburst => Optional[Boolean], offline => Optional[Boolean], auto_offline => Optional[Boolean], prefer => Optional[Boolean], noselect => Optional[Boolean], trust => Optional[Boolean], require => Optional[Boolean], xleave => Optional[Boolean], minpoll => Optional[Integer[-6, 24]], maxpoll => Optional[Integer[-6, 24]], key => Optional[Integer], maxdelay => Optional[Variant[Float[0.0, 1000],Integer[0, 1000]]], maxdelayratio => Optional[Variant[Float,Integer]], maxdelaydevratio => Optional[Variant[Float,Integer]], mindelay => Optional[Variant[Float,Integer]], asymmetry => Optional[Variant[Float,Integer]], offset => Optional[Variant[Float,Integer]], minsamples => Optional[Integer], maxsamples => Optional[Integer], polltarget => Optional[Integer[6, 60]], port => Optional[Stdlib::Port], presend => Optional[Integer], minstratum => Optional[Integer], version => Optional[Integer], burst => Optional[Boolean], }]]]
Array of NTP servers to configure as peers.
Data type: Optional[Array[Struct[{ hostname => String, iburst => Optional[Boolean], offline => Optional[Boolean], auto_offline => Optional[Boolean], prefer => Optional[Boolean], noselect => Optional[Boolean], trust => Optional[Boolean], require => Optional[Boolean], xleave => Optional[Boolean], minpoll => Optional[Integer[-6, 24]], maxpoll => Optional[Integer[-6, 24]], key => Optional[Integer], maxdelay => Optional[Variant[Float[0.0, 1000],Integer[0, 1000]]], maxdelayratio => Optional[Variant[Float,Integer]], maxdelaydevratio => Optional[Variant[Float,Integer]], mindelay => Optional[Variant[Float,Integer]], asymmetry => Optional[Variant[Float,Integer]], offset => Optional[Variant[Float,Integer]], minsamples => Optional[Integer], maxsamples => Optional[Integer], polltarget => Optional[Integer[6, 60]], port => Optional[Stdlib::Port], presend => Optional[Integer], minstratum => Optional[Integer], version => Optional[Integer], maxsources => Optional[Integer], burst => Optional[Boolean], }]]]
Array of NTP server pools to configure.
Data type: Optional[Array[Struct[{ hostnames => Array[String], threshold => Integer, }]]]
Array of initstepslew threshold configurations. See chrony.conf man-page for details of use.
Data type: Optional[Array[Struct[{ driver => Enum['PPS', 'SHM', 'SOCK', 'PHC'], param => String, driver_options => Optional[Hash], poll => Optional[Integer], dpoll => Optional[Integer], refid => Optional[String], lock => Optional[String], rate => Optional[Integer], maxlockage => Optional[Integer], width => Optional[Integer], pps => Optional[Boolean], offset => Optional[Variant[Float,Integer]], delay => Optional[String], precision => Optional[Integer], maxdispersion => Optional[Integer], filter => Optional[Integer], prefer => Optional[Boolean], noselect => Optional[Boolean], trust => Optional[Boolean], require => Optional[Boolean], minsamples => Optional[Integer], maxsamples => Optional[Integer], stratum => Optional[Integer], tai => Optional[Boolean], }]]]
Array of reference clock configurations.
Data type: Optional[Boolean]
Toggles support for the settime command in chronyc. Default value: false.
Data type: Optional[Stdlib::Port]
Configures the source port number to use in outgoing requests.
Data type: Optional[Stdlib::IP::Address]
Sets the source network interface which chrony uses for outgoing requests.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the directory where measurement histories are saved.
Data type: Optional[Integer[0,64]]
Sets the default max number of samples that chrony should keep for each source.
Data type: Optional[Integer[0,64]]
Sets the default min number of samples that chrony should keep for each source.
Data type: Optional[Integer]
Limits which sources are included in the combining algorithm. See chrony.conf man-page for details of use.
Data type: Optional[Integer]
Sets the maximum allowed distance to root for the sources to be considered by the source selection algorithm.
Data type: Optional[Integer]
Sets the maximum allowed amount of jitter for the sources to be considered by the source selection algorithm.
Data type: Optional[Integer]
Sets the minimum number of sources that needs to be available for selection before the local clock is updated.
Data type: Optional[Integer]
Sets the reselect distance. See chrony.conf man-page for details of use.
Data type: Optional[Variant[Float,Integer]]
Sets the amount of distance that should be added per stratum when selecting a source.
Data type: Optional[Integer]
Sets the corrtimeratio. See chrony.conf man-page for details of use.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the chrony driftfile.
Data type: Optional[Tuple[Integer, Integer]]
Sets the fallbackdrift. See chrony.conf man-page for details of use.
Data type: Optional[Enum['system', 'step', 'slew', 'ignore']]
Configures the method used to correct for leap seconds.
Data type: Optional[String]
Set the name of the timezone to use for determining when leap seconds occur.
Data type: Optional[Tuple[Variant[Float,Integer], Variant[Float, Integer]]]
Configures under which circumstances chrony will step the system clock.
Data type: Optional[Tuple[Integer, Integer, Integer]]
Sets the maximum allowed offset corrected on a clock update.
Data type: Optional[Variant[Float,Integer]]
Sets the maxclockerror. See chrony.conf man-page for details of use.
Data type: Optional[Variant[Float,Integer]]
Sets the maximum assumed drift of the system clock.
Data type: Optional[Variant[Float,Integer]]
Sets the maxupdateskew. See chrony.conf man-page for details of use.
Data type: Optional[Variant[Float,Integer]]
Sets the maximum rate at which chrony is allowed to slew the time.
Data type: Optional[Hash]
Configures temperature compensation. See chrony.conf man-page for details of use.
Data type: Optional[Array[Struct[{ access => Enum['allow', 'deny'], all => Optional[Boolean], subnet => Optional[String], }]]]
Ordered array of chrony NTP-server access rules.
Data type: Optional[Stdlib::IP::Address::V4]
IPv4 address on the system that chrony should bind to for offering NTP service.
Data type: Optional[Stdlib::IP::Address::V6]
IPv6 address on the system that chrony should bind to for offering NTP service.
Data type: Optional[Array[Struct[{ interval => Integer, address => Stdlib::IP::Address, port => Optional[Stdlib::Port], }]]]
Array of broadcast configurations, to make chrony advertise time by broadcasting.
Data type: Optional[Integer]
Configures the maximum memory that chrony is allowed to allocate for logging client accesses.
Data type: Optional[Boolean]
Toggles whether client accesses are logged or not. If this statement is present, logging is turned off.
Data type: Optional[Struct[{ stratum => Optional[Integer], distance => Optional[Integer], orphan => Optional[Boolean], }]]
Configures the chrony local reference mode. See chrony.conf man-page for details of use.
Data type: Optional[Stdlib::Port]
Sets the port on which chrony will listen for NTP requests.
Data type: Optional[Struct[{ interval => Optional[Integer[-19,12]], burst => Optional[Integer[1,255]], leak => Optional[Integer[1,4]], }]]
Configures response rate limiting of NTP packets.
Data type: Optional[Struct[{ max_freq => Integer, max_wander => Variant[Float,Integer], leaponly => Optional[Boolean], }]]
Configures smoothing of time that chrony servers to clients. See chrony.conf man-page for details of use.
Data type: Optional[Stdlib::IP::Address::V4]
Configures the IPv4 network interface on which chrony will listen for command packets (ie. from chronyc).
Data type: Optional[Stdlib::IP::Address::V6]
Configures the IPv6 network interface on which chrony will listen for command packets (ie. from chronyc).
Data type: Optional[Stdlib::Absolutepath]
Complete path to the Unix domain command socket.
Data type: Optional[Array[Struct[{ access => Enum['cmdallow', 'cmddeny'], all => Optional[Boolean], subnet => Optional[String], }]]]
An ordered array of command access rules.
Data type: Optional[Stdlib::Port]
Configures the port chrony will listen on for command packets.
Data type: Optional[Struct[{ interval => Optional[Integer[-19,12]], burst => Optional[Integer[1,255]], leak => Optional[Integer[1,4]], }]]
Configures response rate limiting for command packets.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the adjtime file used by the Linux hwclock.
Data type: Optional[Integer]
Sets the rtcautotrim threshold. See chrony.conf man-page for details of use.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the device file for accessing the RTC.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the file where chrony saves RTC tracking parameters.
Data type: Optional[Boolean]
Configures RTC to assume that the RTC is keeping UTC time.
Data type: Optional[Boolean]
Configures chrony to periodically copy system time to the RTC.
Data type: Optional[Struct[{ measurements => Optional[Boolean], statistics => Optional[Boolean], tracking => Optional[Boolean], rtc => Optional[Boolean], refclocks => Optional[Boolean], tempcomp => Optional[Boolean], rawmeasurements => Optional[Boolean], }]]
Configures chrony logging behaviour. See chrony.conf man-page for details of use.
Data type: Optional[Integer]
Sets the frequency with which chrony will print a banner describing the fields of the log file.
Data type: Optional[Variant[Float,Integer]]
Sets the threshold for adjustment of system clock that will generate a syslog message.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the chrony log directory.
Data type: Optional[Struct[{ email => String, threshold => Variant[Float,Integer], }]]
Configures an email address where alerts are sent if chrony applies a correction exceeding a threshold.
Data type: Optional[Array[Stdlib::Absolutepath]]
An array of complete paths to files that will be included in the chrony configuration.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the keyfile for NTP authentication.
Data type: Optional[Boolean]
Configures chrony to lock the daemon into RAM so that it never gets paged out.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the chrony pidfile.
Data type: Optional[Integer[0,100]]
Configures the scheduling priority. See chrony.conf man-page for details of use.
Data type: Optional[String]
Sets the name of the user which runs chrony.
Data type: Optional[Stdlib::Absolutepath]
Complete path to the Samba ntp_signd socket. See chrony.conf man-page for details of use.
Data type: Optional[Array[Struct[{ id => Integer, hashalg => Optional[Enum[ 'MD5', 'SHA1', 'SHA256', 'SHA384', 'SHA512', 'SHA3-224', 'SHA3-256', 'SHA3-384', 'SHA3-512', 'RMD128', 'RMD160', 'RMD256', 'RMD320', 'TIGER', 'WHIRLPOOL', ]], hash => String, }]]]
List of keys used for chrony authentication. Populates the chrony keyfile.
Data type: Optional[Array[Struct[{ interface => String, minpoll => Optional[Integer], precision => Optional[String], txcomp => Optional[Integer], rxcomp => Optional[Integer], nocrossts => Optional[Boolean], rxfilter => Optional[Enum['all', 'ntp', 'none']], }]]]
Array of hwtimestamp configurations, one entry per interface. See chrony.conf man-page for details of use.