Switch VMs at bytemark from ntp to systemd-timesyncd
[mirror/dsa-puppet.git] / modules / time / manifests / init.pp
index 1dcd5ea..1900443 100644 (file)
@@ -1,4 +1,15 @@
 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
+       }
 }