diff --git a/manifests/config.pp b/manifests/config.pp index a3554cfa..a87b45dd 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -33,7 +33,11 @@ } } 'Debian': { - $daemon_config = '/etc/default/ntp' + if $facts['os']['release']['major'] == '12' { + $daemon_config = '/etc/default/ntpsec' + } else { + $daemon_config = '/etc/default/ntp' + } if $ntp::daemon_extra_opts { file_line { 'Set NTPD daemon options': ensure => present, diff --git a/spec/acceptance/ntp_user_and_daemon_opts_spec.rb b/spec/acceptance/ntp_user_and_daemon_opts_spec.rb index 8a65e686..644240ee 100644 --- a/spec/acceptance/ntp_user_and_daemon_opts_spec.rb +++ b/spec/acceptance/ntp_user_and_daemon_opts_spec.rb @@ -17,6 +17,8 @@ else servicename = if os[:family] == 'sles' && os[:release].start_with?('12', '15') 'ntpd' + elsif os[:family] == 'debian' && os[:release].start_with?('12') + 'ntpsec' else 'ntp' end @@ -25,11 +27,13 @@ '/etc/sysconfig/ntpd' elsif os[:family] == 'sles' '/etc/sysconfig/ntp' + elsif os[:family] == 'debian' && os[:release].start_with?('12') + '/etc/default/ntpsec' else '/etc/default/ntp' end describe 'ntp class with daemon options:', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) || (os[:release].start_with?('5') && os[:family] == 'redhat') do - let(:pp) { "class { 'ntp': service_enable => true, service_ensure => running, service_manage => true, service_name => '#{servicename}', user => 'ntp', daemon_extra_opts => '-g -i /var/lib/ntp' }" } + let(:pp) { "class { 'ntp': service_enable => true, service_ensure => running, service_manage => true, service_name => '#{servicename}', user => 'ntp', daemon_extra_opts => '-g -i /var/lib/ntpsec' }" } context 'when run' do it 'is successful' do # rubocop:disable RSpec/NoExpectationExample