Skip to content
Snippets Groups Projects
Commit 79f30669 authored by Maxime Bombar's avatar Maxime Bombar
Browse files

[borgbackups] Initialize borg repository.

parent 2850679c
No related branches found
No related tags found
1 merge request!121Borgbackup
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
owner: root owner: root
group: root group: root
- name: Init borg repository
command:
cmd: /usr/bin/borgmatic init -e repokey
register: borg_init
changed_when: '"does not exist" in borg_init.stderr'
- name: Deploy borg cron - name: Deploy borg cron
template: template:
src: "cron.d/borg.j2" src: "cron.d/borg.j2"
......
...@@ -38,12 +38,17 @@ storage: ...@@ -38,12 +38,17 @@ storage:
umask: 0077 umask: 0077
lock_wait: 5 lock_wait: 5
archive_name_format: '{hostname}-{now}' archive_name_format: '{hostname}-{now}'
{% set extra_init = borg.extra_prune | default([]) %}
{% set extra_prune = borg.extra_prune | default([]) %} {% set extra_prune = borg.extra_prune | default([]) %}
{% set extra_create = borg.extra_create | default([]) %} {% set extra_create = borg.extra_create | default([]) %}
{% set extra_check = borg.extra_check | default([]) %} {% set extra_check = borg.extra_check | default([]) %}
{% if extra_init or extra_prune or extra_create or extra_check %}
extra_borg_options: extra_borg_options:
{% endif %}
{% if extra_init %}
# Extra command-line options to pass to "borg init". # Extra command-line options to pass to "borg init".
init: --make-parent-dirs {% for cmd in borg.extra_init | default([]) %}--{{ cmd }} {% endfor %} init: {% for cmd in extra_init %}--{{ cmd }} {% endfor %}
{% endif %}
{% if extra_prune %} {% if extra_prune %}
# Extra command-line options to pass to "borg prune". # Extra command-line options to pass to "borg prune".
prune: {% for cmd in extra_prune %}--{{ cmd }} {% endfor %} prune: {% for cmd in extra_prune %}--{{ cmd }} {% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment