1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00
ansible_role_restic/tasks/schedule.yml

32 lines
1.1 KiB
YAML

---
- name: create restic systemd timer
ansible.builtin.include_tasks: restic_create_systemd.yml
when:
- ansible_service_mgr == 'systemd'
- restic_schedule_type == "systemd"
- restic_create_schedule | bool
- name: delete systemd timers if available
ansible.builtin.include_tasks: restic_delete_systemd.yml
when:
- ansible_service_mgr == 'systemd'
- restic_schedule_type == "cronjob" or restic_force_cron | default(false)
- restic_create_schedule | bool
- name: delete old cron entry from previous versions of this role
ansible.builtin.include_tasks: delete_legacy_cron_entry.yml
when: restic_do_not_cleanup_cron | bool
- name: install restic via cronjob
ansible.builtin.include_tasks: restic_create_cron.yml
when:
- restic_create_schedule | bool
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false) or restic_schedule_type == "cronjob"
- name: remove restic cronjobs
ansible.builtin.include_tasks: restic_delete_cron.yml
when:
- restic_create_schedule | bool
- ansible_service_mgr == 'systemd'
- not restic_force_cron | default(false)
- restic_schedule_type != "cronjob"