Revitalized the borg role
This commit is contained in:
parent
0087b1fc16
commit
6e49d2b6c7
11 changed files with 85 additions and 37 deletions
|
@ -9,11 +9,17 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|||
export BORG_RSH="ssh -i /root/.ssh/borg"
|
||||
|
||||
{% for job in borg_jobs %}
|
||||
{% if job.pre_command is defined %}
|
||||
{{ 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('-') }}
|
||||
{% else %}
|
||||
borg create borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }}::{{ job.name }}-{now} {{ job.path }}
|
||||
{% endif %}
|
||||
{% if job.post_command is defined %}
|
||||
{{ job.post_command }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
borg prune borg@{{ borg_server }}:/srv/borg/repos/{{ ansible_hostname }} {{ borg_prune_arguments }}
|
||||
|
|
Reference in a new issue