Skip to content
Snippets Groups Projects
Commit 520ed18f authored by Andreas Kempe's avatar Andreas Kempe
Browse files

ntp_server: add class for configuring the NTP server

Configures chrony and gpsd to use the GPS on /dev/ttyS0 and the PPS on
/dev/pps0.
parent 33c11682
No related branches found
No related tags found
No related merge requests found
# NOTE: This file is managed by the timehost::ntp_server puppet class.
# Use public NTP servers from the pool.ntp.org project.
#pool pool.ntp.org iburst
# Backup ntp.se Stockholm servers.
server sth1.ntp.se
server sth2.ntp.se
server sth3.ntp.se
server sth4.ntp.se
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3
# Enable kernel synchronization of the real-time clock (RTC).
rtcsync
bindaddress 130.236.254.17
bindaddress 2001:6b0:17:f0a0::11
allow
refclock SHM 0 refid GPS precision 1e-1 offset 0.9999
refclock SHM 2 refid PPS precision 1e-7
# NOTE: This file is managed by the timehost::ntp_server class.
DEV="/dev/ttyS0 /dev/pps0"
OPTS="-n"
# NTP server configuration.
class timehost::ntp_server {
package {
[
'chrony',
'gpsd',
]:
ensure => installed,
}
service { 'gpsd':
ensure => running,
enable => true,
}
file { '/etc/sv/gpsd/conf':
ensure => present,
source => 'puppet:///modules/timehost/gpsd/conf',
owner => 'root',
group => 'root',
mode => '0644',
notify => Service['gpsd'],
}
service { 'chronyd':
ensure => running,
enable => true,
notify => Service['gpsd'],
}
file { '/etc/chrony.conf':
ensure => present,
source => 'puppet:///modules/timehost/chrony/chrony.conf',
owner => 'root',
group => 'root',
mode => '0644',
notify => Service['chronyd'],
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment