Of course just restoring the default symlink is not sufficient -- we also have to...
[mirror/dsa-puppet.git] / modules / systemdtimesyncd / manifests / init.pp
index bc8fe5f..a0d5b12 100644 (file)
@@ -7,16 +7,9 @@ class systemdtimesyncd {
                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':
@@ -27,5 +20,13 @@ class systemdtimesyncd {
                        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'],
+               }
+
        }
 }