2021-04-29 16:16:35 +02:00
|
|
|
---
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (SCHEDULE) create restic systemd timer
|
2022-01-07 20:13:43 +01:00
|
|
|
ansible.builtin.include_tasks: restic_create_systemd.yml
|
2021-08-02 01:09:02 +02:00
|
|
|
when:
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
- restic_schedule_type == "systemd"
|
|
|
|
- restic_create_schedule | bool
|
2021-04-29 16:16:35 +02:00
|
|
|
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (SCHEDULE) delete systemd timers if available
|
2022-01-07 20:13:43 +01:00
|
|
|
ansible.builtin.include_tasks: restic_delete_systemd.yml
|
2021-04-29 16:16:35 +02:00
|
|
|
when:
|
2022-01-07 20:13:43 +01:00
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
- restic_schedule_type == "cronjob" or restic_force_cron | default(false)
|
2021-08-02 14:13:30 +02:00
|
|
|
- restic_create_schedule | bool
|
2021-08-02 01:09:02 +02:00
|
|
|
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (SCHEDULE) delete old cron entry from previous versions of this role
|
2022-01-07 20:13:43 +01:00
|
|
|
ansible.builtin.include_tasks: delete_legacy_cron_entry.yml
|
|
|
|
when: restic_do_not_cleanup_cron | bool
|
2021-08-02 14:13:30 +02:00
|
|
|
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (SCHEDULE) install restic via cronjob
|
2022-01-07 20:13:43 +01:00
|
|
|
ansible.builtin.include_tasks: restic_create_cron.yml
|
2021-08-02 14:13:30 +02:00
|
|
|
when:
|
|
|
|
- restic_create_schedule | bool
|
|
|
|
- ansible_service_mgr != 'systemd' or restic_force_cron | default(false) or restic_schedule_type == "cronjob"
|
2022-01-10 11:32:43 +01:00
|
|
|
|
2022-01-10 14:19:53 +01:00
|
|
|
- name: (SCHEDULE) remove restic cronjobs
|
2022-01-10 11:32:43 +01:00
|
|
|
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"
|