mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2024-11-19 19:07:42 +01:00
parent
a10b655e89
commit
bebe44d080
@ -37,6 +37,7 @@ bb_quota_size: 0
|
|||||||
bb_alertdays: 0
|
bb_alertdays: 0
|
||||||
bb_repo_name: "{{ inventory_hostname }}"
|
bb_repo_name: "{{ inventory_hostname }}"
|
||||||
bb_sshkey: "{{ root_user['ssh_public_key'] }}"
|
bb_sshkey: "{{ root_user['ssh_public_key'] }}"
|
||||||
|
borgmatic_cron_name: borgmatic
|
||||||
borgmatic_cron_hour: "{{ 6 | random(seed=inventory_hostname) }}"
|
borgmatic_cron_hour: "{{ 6 | random(seed=inventory_hostname) }}"
|
||||||
borgmatic_cron_minute: "{{ 59 | random(seed=inventory_hostname) }}"
|
borgmatic_cron_minute: "{{ 59 | random(seed=inventory_hostname) }}"
|
||||||
borgmatic_cron_checks_day: "{{ range(1, 28) | random(seed=inventory_hostname) }}"
|
borgmatic_cron_checks_day: "{{ range(1, 28) | random(seed=inventory_hostname) }}"
|
||||||
|
@ -16,10 +16,8 @@ platforms:
|
|||||||
image: debian:oldstable
|
image: debian:oldstable
|
||||||
- name: debian-stable
|
- name: debian-stable
|
||||||
image: debian:stable
|
image: debian:stable
|
||||||
- name: ubuntu-xenial
|
- name: ubuntu-bionic
|
||||||
image: ubuntu:xenial
|
image: ubuntu:bionic
|
||||||
# - name: ubuntu-trusty # Python too old
|
|
||||||
# image: ubuntu:trusty
|
|
||||||
- name: ubuntu-latest
|
- name: ubuntu-latest
|
||||||
image: ubuntu:latest
|
image: ubuntu:latest
|
||||||
provisioner:
|
provisioner:
|
||||||
|
@ -87,20 +87,20 @@
|
|||||||
block:
|
block:
|
||||||
- name: Add cron job for regular create and prune
|
- name: Add cron job for regular create and prune
|
||||||
cron:
|
cron:
|
||||||
name: "borgmatic"
|
name: "{{ borgmatic_cron_name }}"
|
||||||
hour: "{{ borgmatic_cron_hour }}"
|
hour: "{{ borgmatic_cron_hour }}"
|
||||||
minute: "{{ borgmatic_cron_minute }}"
|
minute: "{{ borgmatic_cron_minute }}"
|
||||||
user: "root"
|
user: "root"
|
||||||
cron_file: borgmatic
|
cron_file: "{{ borgmatic_cron_name }}"
|
||||||
job: "/usr/local/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} --create --prune"
|
job: "/usr/local/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} --create --prune"
|
||||||
- name: Add cron job for infrequent checks
|
- name: Add cron job for infrequent checks
|
||||||
cron:
|
cron:
|
||||||
name: "borgmatic-check"
|
name: "{{ borgmatic_cron_name }}-check"
|
||||||
day: "{{ borgmatic_cron_checks_day }}"
|
day: "{{ borgmatic_cron_checks_day }}"
|
||||||
hour: "{{ borgmatic_cron_checks_hour }}"
|
hour: "{{ borgmatic_cron_checks_hour }}"
|
||||||
minute: "{{ borgmatic_cron_checks_minute }}"
|
minute: "{{ borgmatic_cron_checks_minute }}"
|
||||||
user: "root"
|
user: "root"
|
||||||
cron_file: borgmatic
|
cron_file: "{{ borgmatic_cron_name }}"
|
||||||
job: "/usr/local/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} --check"
|
job: "/usr/local/bin/borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} --check"
|
||||||
when: borgmatic_large_repo
|
when: borgmatic_large_repo
|
||||||
|
|
||||||
@ -108,22 +108,22 @@
|
|||||||
block:
|
block:
|
||||||
- name: Add cron job for create, check and prune
|
- name: Add cron job for create, check and prune
|
||||||
cron:
|
cron:
|
||||||
name: "borgmatic"
|
name: "{{ borgmatic_cron_name }}"
|
||||||
hour: "{{ borgmatic_cron_hour }}"
|
hour: "{{ borgmatic_cron_hour }}"
|
||||||
minute: "{{ borgmatic_cron_minute }}"
|
minute: "{{ borgmatic_cron_minute }}"
|
||||||
user: "root"
|
user: "root"
|
||||||
cron_file: borgmatic
|
cron_file: "{{ borgmatic_cron_name }}"
|
||||||
job: "/usr/local/bin/borgmatic"
|
job: "/usr/local/bin/borgmatic"
|
||||||
- name: Ensure separate check cron job is absent
|
- name: Ensure separate check cron job is absent
|
||||||
cron:
|
cron:
|
||||||
name: "borgmatic-check"
|
name: "{{ borgmatic_cron_name }}-check"
|
||||||
state: absent
|
state: absent
|
||||||
when: not borgmatic_large_repo
|
when: not borgmatic_large_repo
|
||||||
|
|
||||||
- name: Set PATH for borgmatic cron job.
|
- name: Set PATH for borgmatic cron job.
|
||||||
cron:
|
cron:
|
||||||
user: "root"
|
user: "root"
|
||||||
cron_file: borgmatic
|
cron_file: "{{ borgmatic_cron_name }}"
|
||||||
name: PATH
|
name: PATH
|
||||||
env: yes
|
env: yes
|
||||||
value: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
value: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
Loading…
Reference in New Issue
Block a user