Skip to content

Fix PR #235 and make udlc configurable #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Tells Puppet what NTP service to manage. Valid options: string. Default value: v

####`udlc`

Specifies whether to enable specialized configuration options for an undisciplined local clock, regardless of its status as a virtual machine. Valid options: 'true' or 'false'. Default value: 'false'
Specifies whether to configure ntp to use the undisciplined local clock as a time source, regardless of the node's status as a virtual machine. Valid options: 'true' or 'false'. Default value: 'false' for VMs and 'true' otherwise.

##Limitations

Expand Down
10 changes: 9 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
$service_enable = true
$service_ensure = 'running'
$service_manage = true
$udlc = false
$interfaces = []
$disable_auth = false
$broadcastclient = false
Expand All @@ -24,6 +23,15 @@
default => true,
}

# On virtual systems, disable the use of the undisciplined local clock to
# avoid ntp falling back to the local clock in preference over ntp servers.
# TODO Change this to str2bool($::is_virtual) when stdlib dependency is >= 4
# NOTE The "x${var}" is just to avoid lint quoted variable warning.
$udlc = "x${::is_virtual}" ? {
'xtrue' => false,
default => true,
}

$default_config = '/etc/ntp.conf'
$default_keys_file = '/etc/ntp/keys'
$default_driftfile = '/var/lib/ntp/drift'
Expand Down
8 changes: 4 additions & 4 deletions templates/ntp.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ broadcastclient
server <%= server %><% if @iburst_enable == true -%> iburst<% end %><% if @preferred_servers.include?(server) -%> prefer<% end %>
<% end -%>

<% if @is_virtual == "true" or @udlc -%>
<% if @udlc -%>
# 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
# and when no outside source of synchronized time is available.
server 127.127.1.0
fudge 127.127.1.0 stratum 10
restrict 127.127.1.0
<% end -%>

Expand Down