--- # Re-arm apt's periodic timers after a config or drop-in change. # # WHY A daemon_reload IS REQUIRED AND NOT OPTIONAL. The timer windows are set by drop-ins under # /etc/systemd/system/apt-daily{,-upgrade}.timer.d/. systemd does not re-read unit files on its own, # so until it is told to, the RUNNING manager keeps the shipped schedule and the new window is # ignored — the files look right in git and on disk, `systemctl cat` shows them, and the upgrade # still fires at the old time. That is a silent config no-op, which is the failure mode this whole # role is written against. # # `daemon_reload` re-parses unit files and re-runs generators. It starts and stops nothing, so it # cannot disturb k3s, containerd or Longhorn — the same reasoning node_baseline's "Reload systemd # unit files" handler records. # # RESTARTING THE TIMERS IS ALSO SAFE, and is not the same as running the upgrade. `*.timer` units # only hold the schedule; restarting one recomputes its next elapse and does NOT trigger its # `*.service`. With `Persistent=true` set in the drop-in, a window missed while the node was down is # caught up on the next boot rather than skipped. # # Both fire only when a task actually changed, so a re-run of the role is silent. - name: Restart unattended-upgrades timers ansible.builtin.systemd_service: name: "{{ item }}" state: restarted enabled: true daemon_reload: true loop: - apt-daily.timer - apt-daily-upgrade.timer