refactor(role): systemctl daemon-reload after copy

Since unit files are now copied to '/etc/systemd/system' we should
make sure that systemd sees the newest version of all unit files
before we attempt to enable a timer unit.
This commit is contained in:
hygienic-books 2025-06-04 01:28:57 +02:00
parent 023227fff7
commit 5c3ed1736e

View File

@ -54,6 +54,13 @@
notify:
- 'Reload systemd unit configs'
# Chances are we've just updated systemd unit files in '/etc/systemd/system'. In
# a second we'll be enabling a timer unit that was among those files we just
# (potentially) changed. We should flush our handlers now, i.e. 'systemctl
# daemon-reload' to make sure systemd knows the newest state of our units.
- name: 'Flush handlers'
meta: flush_handlers
- name: 'If Arch Linux enable systemd timer for OS auto-upgrades'
ansible.builtin.systemd_service:
name: 'arch-linux-update-and-restart.timer'