Commit f4aa3b4e authored by remy's avatar remy
Browse files

borgbackup recipe public first commit

parent f55a008e
borg:
servers:
192.168.211.78:
passphrase: B0rg_s3cret
key : |
BORG_KEY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
repo: /media/bigvol/backups/borg
home: /media/bigvol/backups
borguser: borg
host_key: |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
host_key_enc: ssh-rsa
pool: isem211
192.168.212.85:
passphrase: B0rg_s3cret
repo: /home/isi/isi/backups/borg
home: /home/isi/isi/backups
borguser: borg
host_key: |
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
host_key_enc: ssh-rsa
pool: isem212
mine_functions:
get_ssh_rsa_key:
- mine_function: file.read
- /root/.ssh/id_rsa.pub
# from https://borgbackup.readthedocs.io/en/stable/deployment/central-backup-server.html#salt
Install borg backup from pip:
pkg.installed:
- pkgs:
- python3
- python3-dev
- python3-pip
{% if grains['osmajorrelease'] < 20 %}
- python-virtualenv
{% else %}
- python3-virtualenv
{% endif %}
- libssl-dev
- openssl
- libacl1-dev
- libacl1
- build-essential
- libfuse-dev
- fuse
- pkg-config
pip.installed:
- pkgs: ["borgbackup"]
- bin_env: /usr/bin/pip3
{% set BORGDATA = salt['pillar.get']('borg:servers') %}
{% for server, data in BORGDATA.items() %}
{% if server == grains['fqdn_ip4'][0] %}
Check root for home dir:
file.directory:
- name: {{ data['home'] }}
- makedirs: True
Setup backup user:
user.present:
- name: {{ data['borguser'] }}
- fullname: Backup User
- home: {{ data['home'] }}
- uid: 4040
- gid: 4040
- shell: /bin/bash
Check root for borg dir:
file.directory:
- name: {{ data['repo'] }}
- makedirs: True
- user: borg
- group: borg
- recurse:
- user
- group
- mode
{% endif %}
{% endfor %}
# adding ssh keys has been moved to borgbackup.add_clients
\ No newline at end of file
include:
- borgbackup.server.conf
- ..add_clients
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment