Skip to content

Add restrict parameter #34

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
Dec 10, 2012
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
7 changes: 7 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
# '2.debian.pool.ntp.org iburst',
# '3.debian.pool.ntp.org iburst', ]
#
# $restrict = true
# Whether to restrict ntp daemons from allowing others to use as a server.
#
# $autoupdate = false
# Whether to update the ntp package automatically or not.
#
# Actions:
#
# Installs, configures, and manages the ntp service.
Expand All @@ -34,6 +40,7 @@
# [Remember: No empty lines between comments and class definition]
class ntp($servers='UNSET',
$ensure='running',
$restrict=true,
$autoupdate=false
) {

Expand Down
2 changes: 2 additions & 0 deletions templates/ntp.conf.debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ filegen clockstats file clockstats type day enable
server <%= server %>
<% end -%>

<% if @restrict -%>
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
Expand All @@ -50,6 +51,7 @@ restrict ::1
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust

<% end -%>

# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
Expand Down
2 changes: 2 additions & 0 deletions templates/ntp.conf.el.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
tinker panic 0

<% end -%>
<% if @restrict -%>
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
Expand All @@ -18,6 +19,7 @@ restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

<% end -%>
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).

Expand Down