ansible_role_restic/handlers/main.yml
L3D e0f3f5c87c
improve scheduling of backups via cron or timers
improves the handling and differentiation of cronjobs and systemd timers.
Rename the ``restic_create_cron`` variable to``restic_create_schedule``.
Now new: ``restic_schedule_type: "systemd"``.

RESOLVE #22
2021-08-02 01:09:02 +02:00

13 lines
379 B
YAML

---
- name: systemctl restart restic.timer
become: true
ansible.builtin.systemd:
name: "restic-{{ item.name | replace(' ', '') | string }}.timer"
state: 'restarted'
daemon_reload: true
with_items: '{{ restic_backups }}'
when:
- restic_create_schedule
- item.name is defined
- item.scheduled | default(false)
- ansible_service_mgr == 'systemd'