Skip to content

Commit

Permalink
(CAT-2100) Some config changes for debian-12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamshinde360 committed Oct 14, 2024
1 parent 783fb65 commit f55529a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion spec/acceptance/ntp_user_and_daemon_opts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'

Check failure on line 31 in spec/acceptance/ntp_user_and_daemon_opts_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation. (https://rubystyle.guide#spaces-indentation)

Check failure on line 31 in spec/acceptance/ntp_user_and_daemon_opts_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation. (https://rubystyle.guide#spaces-indentation)
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' }" }

Check failure on line 36 in spec/acceptance/ntp_user_and_daemon_opts_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/LineLength: Line is too long. [202/200] (https://rubystyle.guide#max-line-length)

Check failure on line 36 in spec/acceptance/ntp_user_and_daemon_opts_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/LineLength: Line is too long. [202/200] (https://rubystyle.guide#max-line-length)

context 'when run' do
it 'is successful' do # rubocop:disable RSpec/NoExpectationExample
Expand Down

0 comments on commit f55529a

Please sign in to comment.