diff --git a/REFERENCE.md b/REFERENCE.md index 384228bf..353e9b13 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -39,6 +39,12 @@ Data type: `Boolean` Enables reception of broadcast server messages to any local interface. Default value: false. +##### `burst` + +Data type: `Boolean` + +When the server is reachable, send a burst of eight packets instead of the usual one. Default value: false. + ##### `config` Data type: `Stdlib::Absolutepath` @@ -180,6 +186,12 @@ Data type: `Optional[Stdlib::Absolutepath]` Specifies a log file for NTP to use instead of syslog. Default value: ' '. +##### `logconfig` + +Data type: `Optional[String]` + +Specifies the logconfig for NTP to use. Default value: ' '. + ##### `minpoll` Data type: `Optional[Ntp::Poll_interval]` diff --git a/data/common.yaml b/data/common.yaml index 7c57faa2..b0137b12 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -25,6 +25,7 @@ ntp::keys_trusted: [] ntp::keys: [] ntp::leapfile: ~ ntp::logfile: ~ +ntp::logconfig: ~ ntp::ntpsigndsocket: ~ ntp::maxpoll: ~ ntp::minpoll: ~ diff --git a/manifests/config.pp b/manifests/config.pp index c0075502..20a4afdd 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -90,7 +90,7 @@ if $ntp::disable_dhclient { augeas { 'disable ntp-servers in dhclient.conf': - context => '/files/etc/dhcp/dhclient.conf', + context => '/etc/dhcp/dhclient.conf', changes => 'rm request/*[.="ntp-servers"]', } diff --git a/manifests/init.pp b/manifests/init.pp index 97f1b697..89a7a318 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -83,6 +83,9 @@ # @param logfile # Specifies a log file for NTP to use instead of syslog. Default value: ' '. # +# @param logconfig +# Specifies the logconfig for NTP to use. Default value: ' '. +# # @param minpoll # Sets Puppet to non-standard minimal poll interval of upstream servers. # Values: 3 to 16. Default: undef. @@ -226,6 +229,7 @@ Stdlib::Absolutepath $driftfile, Optional[Stdlib::Absolutepath] $leapfile, Optional[Stdlib::Absolutepath] $logfile, + Optional[String] $logconfig, Boolean $iburst_enable, Array[String] $keys, Boolean $keys_enable, diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb index b8736ead..15ea1fec 100644 --- a/spec/classes/ntp_spec.rb +++ b/spec/classes/ntp_spec.rb @@ -800,6 +800,33 @@ end end + describe 'with parameter logconfig' do + context 'when set to true' do + let(:params) do + { + servers: ['a', 'b', 'c', 'd'], + logconfig: '=syncall +peerinfo', + } + end + + it 'contains logconfig setting' do + is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^logconfig =syncall \+peerinfo\n}) + end + end + + context 'when set to false' do + let(:params) do + { + servers: ['a', 'b', 'c', 'd'], + } + end + + it 'does not contain a logconfig line' do + is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{logconfig }) + end + end + end + describe 'with parameter ntpsigndsocket' do context 'when set to true' do let(:params) do diff --git a/templates/ntp.conf.epp b/templates/ntp.conf.epp index bfb6990b..c54e80d1 100644 --- a/templates/ntp.conf.epp +++ b/templates/ntp.conf.epp @@ -90,6 +90,12 @@ driftfile <%= $ntp::driftfile %> logfile <%= $ntp::logfile %> <% } -%> <%# -%> +<% if $ntp::logconfig {-%> + +# Logconfig +logconfig <%= $ntp::logconfig %> +<% } -%> +<%# -%> <% if $ntp::ntpsigndsocket {-%> # Enable signed packets