Refactor systemd handling

- sys-ctl-rpr-btrfs-balancer: suppress service flush for btrfs balancer (too expensive to run each play)
- sys-daemon: replace raw systemctl calls with ansible.builtin.systemd (daemon_reload, daemon_reexec)
- sys-service: split handler into 'Enable systemctl service' and 'Set systemctl service state', add become, async/poll, suppress flush guard

Conversation: https://chatgpt.com/share/68c2f7a6-6fe4-800f-9d79-3e3b0ab4a563
This commit is contained in:
2025-09-11 18:24:21 +02:00
parent 4539817c16
commit 3224e24d76
3 changed files with 21 additions and 5 deletions

View File

@@ -35,14 +35,19 @@
- reexec systemd manager
- name: reload system daemon
command: systemctl daemon-reload
ansible.builtin.systemd:
daemon_reload: true
become: true
listen: reload system daemon
listen:
- reload system daemon
- refresh systemctl service
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
- name: reexec systemd manager
command: systemctl daemon-reexec
# Just execute this during reset, it has potential dangerous side effects
ansible.builtin.systemd:
daemon_reexec: true
become: true
listen: reexec systemd manager
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"