File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 9
9
let ( :conf_path ) do
10
10
if os . include? ( 'solaris' )
11
11
'/etc/inet/ntp.conf'
12
+ elsif f [ :os ] [ 'name' ] == 'Debian' && f [ :os ] [ 'release' ] [ 'major' ] . to_f >= 12
13
+ '/etc/ntpsec/ntp.conf'
14
+ elsif f [ :os ] [ 'name' ] == 'Ubuntu' && f [ :os ] [ 'release' ] [ 'major' ] . to_f >= 24.04
15
+ '/etc/ntpsec/ntp.conf'
12
16
else
13
17
'/etc/ntp.conf'
14
18
end
132
136
case f [ :os ] [ 'family' ]
133
137
when 'RedHat'
134
138
it 'uses the centos ntp servers' do
135
- expect ( subject ) . to contain_file ( '/etc/ntp.conf' ) . with ( 'content' => %r{server \d .centos.pool.ntp.org} )
139
+ expect ( subject ) . to contain_file ( conf_path ) . with ( 'content' => %r{server \d .centos.pool.ntp.org} )
136
140
end
137
141
138
142
it do
139
143
expect ( subject ) . to contain_file ( '/etc/ntp/step-tickers' ) . with ( 'content' => %r{\d .centos.pool.ntp.org} )
140
144
end
141
145
when 'Debian'
142
146
it 'uses the debian ntp servers' do
143
- expect ( subject ) . to contain_file ( '/etc/ntp.conf' ) . with ( 'content' => %r{server \d .debian.pool.ntp.org iburst\n } )
147
+ expect ( subject ) . to contain_file ( conf_path ) . with ( 'content' => %r{server \d .debian.pool.ntp.org iburst\n } )
144
148
end
145
149
when 'Suse'
146
150
it 'uses the opensuse ntp servers' do
147
- expect ( subject ) . to contain_file ( '/etc/ntp.conf' ) . with ( 'content' => %r{server \d .opensuse.pool.ntp.org} )
151
+ expect ( subject ) . to contain_file ( conf_path ) . with ( 'content' => %r{server \d .opensuse.pool.ntp.org} )
148
152
end
149
153
when 'FreeBSD'
150
154
it 'uses the freebsd ntp servers' do
151
- expect ( subject ) . to contain_file ( '/etc/ntp.conf' ) . with ( 'content' => %r{server \d .freebsd.pool.ntp.org iburst maxpoll 9} )
155
+ expect ( subject ) . to contain_file ( conf_path ) . with ( 'content' => %r{server \d .freebsd.pool.ntp.org iburst maxpoll 9} )
152
156
end
153
157
when 'Solaris'
154
158
it 'uses the generic NTP pool servers' do
155
159
expect ( subject ) . to contain_file ( '/etc/inet/ntp.conf' ) . with ( 'content' => %r{server \d .pool.ntp.org} )
156
160
end
157
161
when 'AIX'
158
162
it 'uses the generic NTP pool servers on AIX' do
159
- expect ( subject ) . to contain_file ( '/etc/ntp.conf' ) . with ( 'content' => %r{server \d .pool.ntp.org} )
163
+ expect ( subject ) . to contain_file ( conf_path ) . with ( 'content' => %r{server \d .pool.ntp.org} )
160
164
end
161
165
else
162
166
it {
You can’t perform that action at this time.
0 commit comments