diff --git a/REFERENCE.md b/REFERENCE.md index d2e9ac2..f6127dc 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -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 diff --git a/manifests/init.pp b/manifests/init.pp index a55b8f5..b0c79da 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, @@ -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' { diff --git a/manifests/params.pp b/manifests/params.pp index 63a30ea..018463b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -14,6 +14,7 @@ $service_name = 'chrony' $clientlog = true $rtconutc = true + $dumpdir = '/var/log/chrony' } 'Gentoo' : { $package_name = 'net-misc/chrony' @@ -26,6 +27,7 @@ $service_name = 'chronyd' $clientlog = true $rtconutc = true + $dumpdir = undef } 'Suse', 'RedHat' : { $package_name = 'chrony' @@ -38,6 +40,7 @@ $service_name = 'chronyd' $clientlog = false $rtconutc = false + $dumpdir = undef } 'Debian' : { $package_name = 'chrony' @@ -50,6 +53,7 @@ $service_name = 'chrony' $clientlog = false $rtconutc = false + $dumpdir = undef } default : { diff --git a/templates/chrony.conf.epp b/templates/chrony.conf.epp index 399b55a..01a272b 100644 --- a/templates/chrony.conf.epp +++ b/templates/chrony.conf.epp @@ -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.