mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2025-05-15 01:16:18 +02:00
32 lines
970 B
YAML
32 lines
970 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 }} {{ borgmatic_timer_flags }}"
|
|
|
|
- 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
|
|
...
|