Skip to content

Commit

Permalink
Add parameter dumpdir.
Browse files Browse the repository at this point in the history
To be able to specify directory for chrony to save measurement in on exit. When dumpdir is
set, both option dumponexit and dumpdir is added to chrony.conf

dumponexit and dumpdir was before b971db0 hardcoded in
the template for archlinux.  This commit is restoring the default value for Archlinux, and
leaving the default unset on other os.
  • Loading branch information
chrekh committed Jul 10, 2020
1 parent ec59d0a commit b855fea
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,11 @@ This selects interfaces to enable hardware timestamps on. It can be an array of
or a hash of interfaces to ther respective options.

Default value: []

##### `dumpdir`

Data type: Optional[Stdlib::Unixpath]

Directory for chrony to store measurement in on exit.

Default value: $chrony::params::dumpdir
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
# @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.
# @param dumpdir
# Directory to store measurement history in on exit.
class chrony (
Array[String] $bindcmdaddress = ['127.0.0.1', '::1'],
Array[String] $cmdacl = $chrony::params::cmdacl,
Expand Down Expand Up @@ -229,6 +231,7 @@
Boolean $rtcsync = true,
Boolean $rtconutc = $chrony::params::rtconutc,
Variant[Hash,Array[String]] $hwtimestamps = [],
Optional[Stdlib::Unixpath] $dumpdir = $chrony::params::dumpdir,
) inherits chrony::params {

if ! $config_keys_manage and $chrony_password != 'unset' {
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$service_name = 'chrony'
$clientlog = true
$rtconutc = true
$dumpdir = '/var/log/chrony'
}
'Suse', 'RedHat' : {
$cmdacl = []
Expand All @@ -24,6 +25,7 @@
$service_name = 'chronyd'
$clientlog = false
$rtconutc = false
$dumpdir = undef
}
'Debian' : {
$cmdacl = []
Expand All @@ -35,6 +37,7 @@
$service_name = 'chrony'
$clientlog = false
$rtconutc = false
$dumpdir = undef
}

default : {
Expand Down
6 changes: 6 additions & 0 deletions templates/chrony.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ local stratum <%= $chrony::local_stratum %>

keyfile <%= $chrony::config_keys %>
<% } -%>
<% if $chrony::dumpdir { -%>

# Save the measurement history for the servers to files on exit.
dumponexit
dumpdir <%= $chrony::dumpdir %>
<% } -%>
<% if ! $chrony::clientlog { -%>

# Disable logging of client accesses.
Expand Down

0 comments on commit b855fea

Please sign in to comment.