- 5.153.231.242
allow_dns_query:
- 5.153.231.0/24
+# currently only used by VMs with systemd-timesync
+local-timeservers:
+ - bm-bl1.debian.org
+ - bm-bl2.debian.org
class ntp {
-
package { 'ntp':
ensure => installed
}
--- /dev/null
+class ntp::purge {
+ package { 'ntp':
+ ensure => purged
+ }
+
+ file { '/etc/init.d/ntp':
+ ensure => absent,
+ }
+ file { '/etc/ntp.conf':
+ ensure => absent,
+ }
+ file { '/etc/default/ntp':
+ ensure => absent,
+ }
+
+ file { '/var/lib/ntp':
+ ensure => absent,
+ recurse => true,
+ purge => true,
+ force => true,
+ }
+ file { '/etc/ntp.keys.d':
+ ensure => absent,
+ recurse => true,
+ purge => true,
+ force => true,
+ }
+
+ file { '/etc/munin/plugins/ntp_kernel_err':
+ ensure => absent,
+ }
+ file { '/etc/munin/plugins/ntp_offset':
+ ensure => absent,
+ }
+ file { '/etc/munin/plugins/ntp_states':
+ ensure => absent,
+ }
+ file { '/etc/munin/plugins/ntp_kernel_pll_off':
+ ensure => absent,
+ }
+ file { '/etc/munin/plugins/ntp_kernel_pll_freq':
+ ensure => absent,
+ }
+}
--- /dev/null
+class systemdtimesyncd {
+ $localtimeservers = hiera('local-timeservers', [])
+
+ if (! $systemd) {
+ fail ( "systemdtimesyncd requires systemd." )
+ } elsif (size($localtimeservers) == 0) {
+ fail ( "No local timeservers configured for systemdtimesyncd." )
+ } else {
+ file { '/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service':
+ ensure => 'link',
+ target => '/lib/systemd/system/systemd-timesyncd.service',
+ notify => Exec['systemctl daemon-reload'],
+ }
+
+ service { 'systemd-timesyncd':
+ ensure => running,
+ }
+
+ file { '/etc/systemd/timesyncd.conf':
+ content => template('systemdtimesyncd/timesyncd.conf.erb'),
+ notify => Service['systemd-timesyncd'],
+ }
+ }
+}
--- /dev/null
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# See timesyncd.conf(5) for details
+
+[Time]
+#Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
+<%=
+ servers = []
+ localtimeservers.each do |node|
+ scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |addr|
+ servers << addr
+ end
+ end
+ "Servers="+servers.join(",")
+%>
class time {
- include ntp
- include ntpdate
+ include stdlib
+ $localtimeservers = hiera('local-timeservers', [])
+ $physicalHost = $site::allnodeinfo[$fqdn]['physicalHost']
+
+ # if ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm'
+ # our is_virtual and virtual facts are broken
+ if ($systemd and $physicalHost and size($localtimeservers) > 0) {
+ include ntp::purge
+ include systemdtimesyncd
+ } else {
+ include ntp
+ include ntpdate
+ }
}