From f084bd976cf942a43df7bbc77c63e21bf1045970 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 5 Jul 2022 21:15:26 +0200 Subject: Fixed authorized_keys configuration drift, and change repo directory from hostname to fqdn --- templates/authorized_keys | 3 +++ templates/backup.sh.j2 | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 templates/authorized_keys (limited to 'templates') diff --git a/templates/authorized_keys b/templates/authorized_keys new file mode 100644 index 0000000..49c8820 --- /dev/null +++ b/templates/authorized_keys @@ -0,0 +1,3 @@ +{% for client in borg.server.clients %} +command="borg serve --restrict-to-path /srv/borg/repos/{{ client.hostname }}",restrict {{ client.pubkey }} +{% endfor %} diff --git a/templates/backup.sh.j2 b/templates/backup.sh.j2 index 3937dfc..57d1854 100644 --- a/templates/backup.sh.j2 +++ b/templates/backup.sh.j2 @@ -15,13 +15,13 @@ 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.command_to_pipe }} | borg create borg@{{ borg_server }}:/srv/borg/repos/{{ inventory_hostname }}::{{ job.name }}-{now} - {% else %} -borg create {% for exclude in job.exclude|default([]) %} --exclude {{ exclude }}{% endfor %} 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/{{ inventory_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 }} +borg prune borg@{{ borg_server }}:/srv/borg/repos/{{ inventory_hostname }} {{ borg_prune_arguments }} -- cgit v1.2.3