Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit a58a52c2 authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

feat: add Ansible role Restic to use S3 backups

parent 888d14cd
No related branches found
No related tags found
No related merge requests found
...@@ -76,6 +76,18 @@ ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i { ...@@ -76,6 +76,18 @@ ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {
N'hésitez pas à regarder les variables disponibles dans le [rôle](https://github.com/borgbase/ansible-role-borgbackup). N'hésitez pas à regarder les variables disponibles dans le [rôle](https://github.com/borgbase/ansible-role-borgbackup).
### Sauvegardes distantes avec Restic
- Les sauvegardes avec [Restic](https://restic.net/) : Grâce au rôle Ansible `do1jlr.restic`, nous pouvons automatiser le processus d'installation et de configuration de Restic sur un serveur YunoHost. Les sauvegardes Borg Restic accessibles sur un dépôt Restic en local ou à distance et compatible stockage objet S3. Plus d'info sur ce rôle [ici](https://github.com/roles-ansible/ansible_role_restic).
⚠️ Attention, pour pouvoir utiliser le rôle Ansible `do1jlr.restic`, vous devez avoir les paquets suivants installé sur la machine qui exécute Ansible : `bzip2` (binaire disponible sur la plupart des systèmes Linux) et `jmespath` (paquet python, installable avec pip).
```yml
```
N'hésitez pas à regarder les variables disponibles dans le [rôle](https://github.com/borgbase/ansible-role-borgbackup).
## Dépendances ## Dépendances
Le rôle `m3nu.ansible_role_borgbackup` sera installé sur la machine exécutant Ansible pour que les tâches liées à Borg fonctionnent. Un fichier `requirements.yml` est à la racine du rôle et va télécharger le rôle (par défaut vers `~/.ansible/roles`). Le rôle `m3nu.ansible_role_borgbackup` sera installé sur la machine exécutant Ansible pour que les tâches liées à Borg fonctionnent. Un fichier `requirements.yml` est à la racine du rôle et va télécharger le rôle (par défaut vers `~/.ansible/roles`).
......
...@@ -75,6 +75,16 @@ borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519" ...@@ -75,6 +75,16 @@ borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519"
Feel free to look at the variables available in the [role](https://github.com/borgbase/ansible-role-borgbackup). Feel free to look at the variables available in the [role](https://github.com/borgbase/ansible-role-borgbackup).
### remote backups with YunoHost Restic
- Backups with [Restic](https://restic.net/): Thanks to the Ansible role `do1jlr.restic` we can automate the installation and configuration process of Restic on a YunoHost server. Restic backups are accessible on a local or a remote Restic repository and compatible with S3 object storage. More info about this role [here](https://github.com/roles-ansible/ansible_role_restic).
```yml
```
Feel free to look at the variables available in the [role](https://github.com/roles-ansible/ansible_role_restic).
## Dependencies ## Dependencies
The `m3nu.ansible_role_borgbackup` role will be installed on the machine running Ansible for Borg-related tasks to work. A `requirements.yml` file is in the root of the role and will download the role (by default to `~/.ansible/roles`). The `m3nu.ansible_role_borgbackup` role will be installed on the machine running Ansible for Borg-related tasks to work. A `requirements.yml` file is in the root of the role and will download the role (by default to `~/.ansible/roles`).
......
...@@ -30,3 +30,8 @@ borg_repository: "/data/backup/live" ...@@ -30,3 +30,8 @@ borg_repository: "/data/backup/live"
borg_init_command: "borgmatic init -c /etc/borgmatic/{{ borgmatic_config_name }} -e repokey --syslog-verbosity 1" borg_init_command: "borgmatic init -c /etc/borgmatic/{{ borgmatic_config_name }} -e repokey --syslog-verbosity 1"
borg_archive_name_format: "'{hostname}-yunohost-live-data-{now:%Y-%m-%d-%H%M%S}'" borg_archive_name_format: "'{hostname}-yunohost-live-data-{now:%Y-%m-%d-%H%M%S}'"
ynh_borg_backup_remote_repo: False ynh_borg_backup_remote_repo: False
# Variables for YunoHost Restic
# https://github.com/roles-ansible/ansible_role_restic
ynh_restic_backup_scheduled: False
restic_schedule_type: "cronjob"
...@@ -23,9 +23,16 @@ ...@@ -23,9 +23,16 @@
when: ynh_backup.scheduled when: ynh_backup.scheduled
tags: backup tags: backup
- name: Use Borg Backup with YunoHost - name: Use BorgBackup with YunoHost
ansible.builtin.include_tasks: borgbackup.yml ansible.builtin.include_tasks: borgbackup.yml
when: ynh_borg_backup_scheduled when: ynh_borg_backup_scheduled
tags: tags:
- backup - backup
- borg - borg
- name: Use Restic with YunoHost
ansible.builtin.include_tasks: restic.yml
when: ynh_restic_backup_scheduled
tags:
- backup
- restic
---
#-----------------------------------------------------------------------------#
# ansible-yunohost allows to deploy Yunohost using Ansible #
# Copyright 2021-present Lydra https://www.lydra.fr/ #
# #
# this program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# this program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
#-----------------------------------------------------------------------------#
- name: Download Restic role on localhost
ansible.builtin.command: ansible-galaxy install do1jlr.restic,v0.7.1 -p ~/.ansible/roles
delegate_to: localhost
become: False
tags:
- backup
- restic
- name: Gather facts for Restic role
ansible.builtin.setup:
tags:
- backup
- restic
- name: run Restic role
ansible.builtin.import_role:
name: do1jlr.restic
tags:
- backup
- restic
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment