Place restrict options to NTP explicitly

To avoid undesirable restrict options in target
config file, pass them explicitly when ntp task
executed.

Also noop tests for ntp manifests change such way
that they really run now.

Change-Id: I110b4b7c2e42dffc9449f54689236ff1582717cb
Closes-Bug: #1505235
This commit is contained in:
Stanislaw Bogatkin 2015-10-14 21:13:26 -05:00 committed by Denis V. Meltsaykin
parent 7e2385674b
commit 2626eee51d
2 changed files with 26 additions and 8 deletions

View File

@ -3,14 +3,20 @@ notice('MODULAR: ntp-server.pp')
$ntp_servers = hiera('external_ntp')
class { 'ntp':
servers => strip(split($ntp_servers['ntp_list'], ',')),
service_enable => true,
service_ensure => 'running',
iburst_enable => true,
tinker => true,
panic => '0',
stepout => '5',
minpoll => '3',
servers => strip(split($ntp_servers['ntp_list'], ',')),
service_enable => true,
service_ensure => 'running',
iburst_enable => true,
tinker => true,
panic => '0',
stepout => '5',
minpoll => '3',
restrict => [
'-4 default kod nomodify notrap nopeer noquery',
'-6 default kod nomodify notrap nopeer noquery',
'127.0.0.1',
'::1',
],
}
class { 'cluster::ntp_ocf': }

View File

@ -3,6 +3,18 @@ require 'shared-examples'
manifest = 'ntp/ntp-server.pp'
describe manifest do
shared_examples 'catalog' do
it 'should pass restrictions explicitly' do
should contain_class('ntp').with(
'restrict' => [
'-4 default kod nomodify notrap nopeer noquery',
'-6 default kod nomodify notrap nopeer noquery',
'127.0.0.1',
'::1',
])
end
end
test_ubuntu_and_centos manifest
end