mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
32 lines
942 B
YAML
32 lines
942 B
YAML
|
---
|
||
|
- name: Ensure Cron is installed
|
||
|
ansible.builtin.package:
|
||
|
name: "{{ borg_cron_package }}"
|
||
|
state: present
|
||
|
|
||
|
- name: Add Cron job for borgmatic
|
||
|
block:
|
||
|
- name: Add single Cron job for borgmatic
|
||
|
cron:
|
||
|
name: "{{ borgmatic_timer_cron_name }}"
|
||
|
hour: "{{ borgmatic_timer_hour }}"
|
||
|
minute: "{{ borgmatic_timer_minute }}"
|
||
|
user: "{{ borg_user }}"
|
||
|
cron_file: "{{ borgmatic_timer_cron_name }}"
|
||
|
job: "borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }}"
|
||
|
|
||
|
- name: Ensure separate check cron job is absent
|
||
|
cron:
|
||
|
name: "{{ borgmatic_timer_cron_name }}-check"
|
||
|
cron_file: "{{ borgmatic_timer_cron_name }}"
|
||
|
state: absent
|
||
|
|
||
|
- name: Set PATH for borgmatic cron job.
|
||
|
cron:
|
||
|
user: "{{ borg_user }}"
|
||
|
cron_file: "{{ borgmatic_timer_cron_name }}"
|
||
|
name: PATH
|
||
|
env: yes
|
||
|
value: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
...
|