A simple Ansible Playbook to install and set up BorgBackup.
- You need
borg initthe target repository first; - If passing
-e borg_setup_pubkey=True, a pair of SSH key would be generated on the host to be backed up (if not existed), and installed to the backup host; - If using rsync.net as backup host, special tasks would be run to ensure the installation of the public key.
- Copy
hosts.exampletohostsand edit it properly. - Optionally edit the vars in
site.yaml. They can be overridden by-e key=value. - Run
ansible-playbook -i hosts site.yaml.