1 class systemdtimesyncd {
2 $localtimeservers = hiera('local-timeservers', [])
5 fail ( "systemdtimesyncd requires systemd." )
6 } elsif (size($localtimeservers) == 0) {
7 fail ( "No local timeservers configured for systemdtimesyncd." )
9 file { '/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service':
11 target => '/lib/systemd/system/systemd-timesyncd.service',
12 notify => Exec['systemctl daemon-reload'],
15 service { 'systemd-timesyncd':
19 file { '/etc/systemd/timesyncd.conf':
20 content => template('systemdtimesyncd/timesyncd.conf.erb'),
21 notify => Service['systemd-timesyncd'],
24 # Up until 2019-09 we had timesyncd started by multi-user.target instead of the default
25 # sysinit.target.wants. We are moving back to sysinit.target.wants (for now).
26 file { '/etc/systemd/system/multi-user.target.wants/systemd-timesyncd.service':
28 notify => Exec['systemctl daemon-reload'],