borg_server
Ansible Role: Borg Server
- Installs BorgBackup.
- Sets up SSH
authorized_keys
to allow clients to use their repositories (and nothing else).
Made to work with my other role, yurihs.borg_client.
Role variables (default values)
borg_server_user: borg
borg_server_group: borg
Who will be able to access the keys and repos.
borg_server_dir: /srv/borg
Where the repos will be stored.
borg_server_clients: []
A list of clients that may connect. Each client should have a name
and a key
, and may have append_only
set to true
to restrict it to "append only" mode (if borg_server_append_only
is true
, setting this to false
will have no effect).
borg_server_append_only: false
Restrict all clients to "append only" mode.
Example
- hosts: backup
vars:
borg_server_clients:
- name: client_a
key: "{{ lookup('file', playbook_dir + '/keys/id_client_a.pub') }}"
- name: client_b
key: "{{ lookup('file', playbook_dir + '/keys/id_client_b.pub') }}"
append_only: true
roles:
- role: yurihs.borg_server
become: true
"Client A" may create a repo using the following command:
borg init [email protected]:my_repo
Their repo will be created at /srv/borg/repos/client_a/my_repo
.
"Client B" may do the same, but it will only be able to access the repo in "append only" mode.
Install
ansible-galaxy install yurihs/ansible-role-borg-server
License
mit
Downloads
77
Owner