1
0
Fork 0

Simplified and fixed borg role

This commit is contained in:
Julien Dessaux 2021-02-22 21:55:29 +01:00
parent 91b773e12e
commit cab3d045c1
3 changed files with 17 additions and 41 deletions

View file

@ -13,9 +13,9 @@ export BORG_RSH="ssh -i /root/.ssh/borg"
{{ job.pre_command }}
{% endif %}
{% if job.command_to_pipe is defined %}
{{ job.command_to_pipe }} | borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path | default('-') }}
{{ job.command_to_pipe }} | borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} -
{% else %}
borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path }}
borg create {% for exclude in job.exclude|default([]) %} --exclude {{ exclude }}{% endfor %} borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path }}
{% endif %}
{% if job.post_command is defined %}
{{ job.post_command }}