fail ( "No local timeservers configured for systemdtimesyncd." )
} else {
file { '/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service':
- ensure => 'absent',
- notify => Exec['systemctl daemon-reload'],
- }
- file { '/etc/systemd/system/multi-user.target.wants':
- ensure => 'directory',
- }
- file { '/etc/systemd/system/multi-user.target.wants/systemd-timesyncd.service':
- ensure => 'link',
- target => '/lib/systemd/system/systemd-timesyncd.service',
- notify => Exec['systemctl daemon-reload'],
+ ensure => 'link',
+ target => '/lib/systemd/system/systemd-timesyncd.service',
+ notify => Exec['systemctl daemon-reload'],
}
service { 'systemd-timesyncd':
content => template('systemdtimesyncd/timesyncd.conf.erb'),
notify => Service['systemd-timesyncd'],
}
+
+ # Up until 2019-09 we had timesyncd started by multi-user.target instead of the default
+ # sysinit.target.wants. We are moving back to sysinit.target.wants (for now).
+ file { '/etc/systemd/system/multi-user.target.wants/systemd-timesyncd.service':
+ ensure => 'absent',
+ notify => Exec['systemctl daemon-reload'],
+ }
+
}
}