Skip to content

Commit

Permalink
Merge pull request redhat-openstack#254 from juniorsysadmin/udlc-stratum
Browse files Browse the repository at this point in the history
(MODULES-1837) Make udlc stratum configurable
  • Loading branch information
tphoney committed Apr 9, 2015
2 parents 789d47a + bbf6635 commit 03d8b2c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ Tells Puppet what NTP service to manage. Valid options: string. Default value: v

Specifies whether to configure ntp to use the undisciplined local clock as a time source. Valid options: 'true' or 'false'. Default value: 'false'

####`udlc_stratum`

Specifies the stratum the server should operate at when using the undisciplined local clock as the time source. It is strongly suggested that this value be set to no less than 10 where ntpd may be accessible outside your immediate, controlled network. Default value: 10

##Limitations

This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified.
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$service_manage = $ntp::params::service_manage,
$service_name = $ntp::params::service_name,
$udlc = $ntp::params::udlc,
$udlc_stratum = $ntp::params::udlc_stratum,
) inherits ntp::params {

validate_bool($broadcastclient)
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$service_ensure = 'running'
$service_manage = true
$udlc = false
$udlc_stratum = '10'
$interfaces = []
$disable_auth = false
$broadcastclient = false
Expand Down
12 changes: 12 additions & 0 deletions spec/acceptance/ntp_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,16 @@ class { 'ntp':
end
end

describe 'udlc_stratum' do
it 'sets the stratum value when using udlc' do
pp = "class { 'ntp': udlc => true, udlc_stratum => 10 }"
apply_manifest(pp, :catch_failures => true)
end

describe file("#{config}") do
it { should be_file }
its(:content) { should match 'stratum 10' }
end
end

end
2 changes: 1 addition & 1 deletion templates/ntp.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ server <%= server %><% if @iburst_enable == true -%> iburst<% end %><% if @prefe
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server 127.127.1.0
fudge 127.127.1.0 stratum 10
fudge 127.127.1.0 stratum <%= @udlc_stratum %>
restrict 127.127.1.0
<% end -%>

Expand Down

0 comments on commit 03d8b2c

Please sign in to comment.