Skip to content

Commit

Permalink
Add parameter hwtimestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
chrekh committed Jul 10, 2020
1 parent 5d5e89e commit 5dde724
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,11 @@ See [clientloglimit](https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html#clien

Default value: `undef`

##### `hwtimestamps`

Data type: `Variant[Hash,Array[String]]`

This selects interfaces to enable hardware timestamps on. It can be an array of interfaces
or a hash of interfaces to ther respective options.

Default value: []
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
# Keep RTC in UTC instead of local time.
# If not set, chrony's, default will be used. On Arch Linux the default is true instead.
# See [rtconutc](https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html#rtconutc)
# @param hwtimestamps
# This selects interfaces to enable hardware timestamps on. It can be an array of
# interfaces or a hash of interfaces to their respective options.
class chrony (
Array[String] $bindcmdaddress = ['127.0.0.1', '::1'],
Array[String] $cmdacl = $chrony::params::cmdacl,
Expand Down Expand Up @@ -222,6 +225,7 @@
Optional[Float] $maxslewrate = undef,
Optional[Numeric] $stratumweight = undef,
Boolean $rtconutc = $chrony::params::rtconutc,
Variant[Hash,Array[String]] $hwtimestamps = [],
) inherits chrony::params {

if ! $config_keys_manage and $chrony_password != 'unset' {
Expand Down
9 changes: 9 additions & 0 deletions templates/chrony.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,12 @@ smoothtime <%= $chrony::smoothtime %>
# https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html#rtconutc
rtconutc
<% } -%>
<% if ! $chrony::hwtimestamps.empty { -%>

# Enable hardware timestamping of NTP packets sent to and received from the specified
# network interface. If the specified interface is *, chronyd will try to enable HW
# timestamping on all available interfaces.
<% $chrony::hwtimestamps.each |$interface| { -%>
hwtimestamp <%= $interface.flatten.join(' ') %>
<% } -%>
<% } -%>

0 comments on commit 5dde724

Please sign in to comment.