diff --git a/files/chrony/chrony.conf b/files/chrony/chrony.conf new file mode 100644 index 0000000000000000000000000000000000000000..00ea774d26312b9f6e3b6f3a3baccb855f2e425f --- /dev/null +++ b/files/chrony/chrony.conf @@ -0,0 +1,26 @@ +# 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 diff --git a/files/gpsd/conf b/files/gpsd/conf new file mode 100644 index 0000000000000000000000000000000000000000..156d25bc66e489f2fb6b8e4c8ac1f9da27bcc05a --- /dev/null +++ b/files/gpsd/conf @@ -0,0 +1,3 @@ +# NOTE: This file is managed by the timehost::ntp_server class. +DEV="/dev/ttyS0 /dev/pps0" +OPTS="-n" diff --git a/manifests/ntp_server.pp b/manifests/ntp_server.pp new file mode 100644 index 0000000000000000000000000000000000000000..5f0bb2178df8c93920525485b138218fcb1470bb --- /dev/null +++ b/manifests/ntp_server.pp @@ -0,0 +1,39 @@ +# 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'], + } +}