From c76abf8f3fd8dc10bc2f9717dae8712220133090 Mon Sep 17 00:00:00 2001 From: Arthur BOUDREAULT Date: Mon, 5 Sep 2022 15:15:30 +0200 Subject: [PATCH 1/4] build: update Borg Ansible role to v0.9.3 --- roles/ynh_backup/tasks/borgbackup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ynh_backup/tasks/borgbackup.yml b/roles/ynh_backup/tasks/borgbackup.yml index 2dbfc28..29424da 100644 --- a/roles/ynh_backup/tasks/borgbackup.yml +++ b/roles/ynh_backup/tasks/borgbackup.yml @@ -18,7 +18,7 @@ # # #-----------------------------------------------------------------------------# - name: Download BorgBackup role on localhost - ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,v0.9.0 -p "{{ _ansible_role_directory }}" + ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,v0.9.3 -p "{{ _ansible_role_directory }}" delegate_to: localhost become: False tags: From 7c38d93fef01b95abf90df3be7cd00ebdc73b21d Mon Sep 17 00:00:00 2001 From: Arthur BOUDREAULT Date: Mon, 5 Sep 2022 15:20:17 +0200 Subject: [PATCH 2/4] build: create ansible-galaxy build 1.1.1 --- CHANGELOG.md | 7 +++++++ galaxy.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95061bd..8c356a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and the commits message folow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). +## [[1.1.1] - 2022-09-05](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/releases/1.1.1) + +### Fixed + +- In role `ynh_backup`: + - Ansible role Borg has been updated to v0.9.3 due to a bug that I discovered. More info [here](https://github.com/borgbase/ansible-role-borgbackup/issues/101). + ## [[1.1.0] - 2022-08-30](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/releases/1.1.0) ### Added diff --git a/galaxy.yml b/galaxy.yml index 15a59e1..a4969b2 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: lydra name: yunohost -version: 1.1.0 +version: 1.1.1 readme: README.md authors: - Lydra () From d18f3590ee7718f3305b6963bfbf711d00119d57 Mon Sep 17 00:00:00 2001 From: Arthur BOUDREAULT Date: Tue, 6 Sep 2022 10:50:08 +0200 Subject: [PATCH 3/4] docs: update general readme for restic tag --- README-FR.md | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README-FR.md b/README-FR.md index ee52760..b9be3fe 100644 --- a/README-FR.md +++ b/README-FR.md @@ -44,6 +44,7 @@ Ces tags sont applicables suivant les rôles. |smtp|Tâches liées aux paramètres de relais smtp de Yunohost.| |backup|Tâches liées aux sauvegardes de Yunohost en local.| |borg|Tâches liées aux sauvegardes avec BorgBackup.| +|restic|Tâches liées aux sauvegardes avec Restic.| ## License diff --git a/README.md b/README.md index 4b101a6..5bda853 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ These tags are applicable to roles. |smtp|Tasks related to Yunohost smtp relay settings.| |backup|Tasks related to local Yunohost backups.| |borg|Tasks related to backups with BorgBackup.| +|restic|Tasks related to backups with Restic.| ## License From 5073d9bf70e457c6d2e5c0115fc107aa2e995a58 Mon Sep 17 00:00:00 2001 From: Arthur BOUDREAULT Date: Tue, 6 Sep 2022 11:00:56 +0200 Subject: [PATCH 4/4] feat: add m3nu_ansible_role_borgbackup_version to change version as we wish --- CHANGELOG.md | 9 +++++++++ roles/ynh_backup/README-FR.md | 24 +++++++++++++----------- roles/ynh_backup/README.md | 24 +++++++++++++----------- roles/ynh_backup/defaults/main.yml | 23 ++++++++++++----------- roles/ynh_backup/tasks/borgbackup.yml | 2 +- 5 files changed, 48 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c356a9..e1f3d55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,15 @@ and the commits message folow the [Conventional Commits](https://www.conventiona ## [[1.1.1] - 2022-09-05](https://lab.frogg.it/lydra/yunohost/ansible-yunohost/-/releases/1.1.1) +### Added + +- In role `ynh_backup`: + - Added Ansible variable `m3nu_ansible_role_borgbackup_version`. The default version of the role is v0.9.3, but it can easily be changed by overriding the default value. You can check the releases of the role [here](https://github.com/borgbase/ansible-role-borgbackup). + - Updated the readme files. + +- In general readme: + - Added restic tag. + ### Fixed - In role `ynh_backup`: diff --git a/roles/ynh_backup/README-FR.md b/roles/ynh_backup/README-FR.md index 5e379d9..a5fee6d 100644 --- a/roles/ynh_backup/README-FR.md +++ b/roles/ynh_backup/README-FR.md @@ -47,21 +47,23 @@ ynh_backup: - Les sauvegardes avec [BorgBackup](https://borgbackup.readthedocs.io/en/stable/) et [Borgmatic](https://github.com/witten/borgmatic) : Grâce au rôle Ansible `m3nu.ansible_role_borgbackup`, nous pouvons automatiser le processus d'installation et de configuration de BorgBackup sur un serveur YunoHost. Les sauvegardes Borg sont accessibles sur un dépôt Borg local ou distant. Plus d'info sur ce rôle [ici](https://github.com/borgbase/ansible-role-borgbackup) ```yml -ynh_borg_backup_scheduled: True -borg_source_directories: "{{ ynh_backup.directory }}" -borg_repository: "/data/backup/borg_repository" -borg_encryption_passphrase: "PLEASECHANGEME" -borgmatic_config_name: "borgmatic_ynh_config" -borgmatic_cron_name: "borgmatic_ynh_cron" +ynh_borg_backup_scheduled: True +m3nu_ansible_role_borgbackup_version: "v0.9.3" +borg_source_directories: "{{ ynh_backup.directory }}" +borg_repository: "/data/backup/borg_repository" +borg_encryption_passphrase: "PLEASECHANGEME" +borgmatic_config_name: "borgmatic_ynh_config" +borgmatic_cron_name: "borgmatic_ynh_cron" borg_retention_policy: - keep_daily: "4" -ynh_borg_backup_remote_repo: True -borg_ssh_keys_src: "files/prd/ssh_keys/ynh_ed25519.vault" -borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519" -ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {{ borg_ssh_keys_dest }}" + keep_daily: "4" +ynh_borg_backup_remote_repo: True +borg_ssh_keys_src: "files/prd/ssh_keys/ynh_ed25519.vault" +borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519" +ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {{ borg_ssh_keys_dest }}" ``` - `ynh_borg_backup_scheduled` : Active / désactive la fonctionnalité de sauvegarde avec BorgBackup. +- `m3nu_ansible_role_borgbackup_version` : Vous permet de spécifier la version du rôle Ansible Borg Backup que vous souhaitez utiliser. La version par défaut du rôle est v0.9.3 mais vous pouvez vérifier les versions du rôle [ici](https://github.com/borgbase/ansible-role-borgbackup). - `ynh_borg_backup_remote_repo` : Active / désactive la fonctionnalité de sauvegarde sur un dépôt distant BorgBackup (tâches liées à la mise en place des clés SSH). Si vous activez cette fonctionnalité, vous aurez besoin d'utiliser les variables `borg_ssh_keys_src` et `borg_ssh_keys_dest`. - `borg_source_directories` : Liste des dossiers source à sauvegarder. Par défaut, il s'agit du dossier qui contient les sauvegardes faites par YunoHost. - `borg_repository` : Chemin complet vers le dépôt Borg. Possibilité de donner une liste de dépôts pour sauvegarder les données dans plusieurs endroits. diff --git a/roles/ynh_backup/README.md b/roles/ynh_backup/README.md index bf38ae3..5c41c8c 100644 --- a/roles/ynh_backup/README.md +++ b/roles/ynh_backup/README.md @@ -47,21 +47,23 @@ ynh_backup: - Backups with [BorgBackup](https://borgbackup.readthedocs.io/en/stable/) and [Borgmatic](https://github.com/witten/borgmatic): Thanks to the Ansible role `m3nu.ansible_role_borgbackup` we can automate the installation and configuration process of Borg Backup on a YunoHost server. Borg backups are accessible on a local or a remote Borg repository. More info about this role [here](https://github.com/borgbase/ansible-role-borgbackup). ```yml -ynh_borg_backup_scheduled: True -borg_source_directories: "{{ ynh_backup.directory }}" -borg_repository: "/data/backup/borg_repository" -borg_encryption_passphrase: "PLEASECHANGEME" -borgmatic_config_name: "borgmatic_ynh_config" -borgmatic_cron_name: "borgmatic_ynh_cron" +ynh_borg_backup_scheduled: True +m3nu_ansible_role_borgbackup_version: "v0.9.3" +borg_source_directories: "{{ ynh_backup.directory }}" +borg_repository: "/data/backup/borg_repository" +borg_encryption_passphrase: "PLEASECHANGEME" +borgmatic_config_name: "borgmatic_ynh_config" +borgmatic_cron_name: "borgmatic_ynh_cron" borg_retention_policy: - keep_daily: "4" -ynh_borg_backup_remote_repo: True -borg_ssh_keys_src: "files/prd/ssh_keys/ynh_ed25519.vault" -borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519" -ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {{ borg_ssh_keys_dest }}" + keep_daily: "4" +ynh_borg_backup_remote_repo: True +borg_ssh_keys_src: "files/prd/ssh_keys/ynh_ed25519.vault" +borg_ssh_keys_dest: "/home/debian/.ssh/ynh_ed25519" +ynh_ssh_borg_command: "ssh_command: ssh -p 7410 -o StrictHostKeychecking=no -i {{ borg_ssh_keys_dest }}" ``` - `ynh_borg_backup_scheduled`: Enable / disable the backup feature with BorgBackup. +- `m3nu_ansible_role_borgbackup_version`: Allows you to specify which version of the Borg Backup Ansible role you want to use. The default version of the role is v0.9.3 but you can check the releases of the role [here](https://github.com/borgbase/ansible-role-borgbackup). - `ynh_borg_backup_remote_repo`: Enable / disable the backup functionality on a BorgBackup remote repository (tasks related to SSH keys setup). If you enable this feature, then you will need to use `borg_ssh_keys_src` and `borg_ssh_keys_dest` variables. - `borg_source_directories`: List of source folders to back up. By default, this is the folder in which YunoHost local backups are located. - `borg_repository`: Full path to the Borg repository. Possibility to give a list of repositories to save data in several places. diff --git a/roles/ynh_backup/defaults/main.yml b/roles/ynh_backup/defaults/main.yml index d542202..9d91a00 100644 --- a/roles/ynh_backup/defaults/main.yml +++ b/roles/ynh_backup/defaults/main.yml @@ -20,21 +20,22 @@ # Variables for local YunoHost backups ynh_backup: - scheduled: False + scheduled: False # Variables for YunoHost BorgBackup -ynh_borg_backup_scheduled: False +ynh_borg_backup_scheduled: False +m3nu_ansible_role_borgbackup_version: "v0.9.3" borg_source_directories: - "/home/yunohost.backup" -borg_repository: "/data/backup/borg_repository" -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}'" -ynh_borg_backup_remote_repo: False +borg_repository: "/data/backup/borg_repository" +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}'" +ynh_borg_backup_remote_repo: False # Variables for YunoHost Restic # https://github.com/roles-ansible/ansible_role_restic -ynh_restic_backup_scheduled: False -do1jlr_restic_version: "v0.7.1" -restic_version: "0.12.1" -restic_schedule_type: "cronjob" -restic_keep_time: "0y1m0d0h" +ynh_restic_backup_scheduled: False +do1jlr_restic_version: "v0.7.1" +restic_version: "0.12.1" +restic_schedule_type: "cronjob" +restic_keep_time: "0y1m0d0h" diff --git a/roles/ynh_backup/tasks/borgbackup.yml b/roles/ynh_backup/tasks/borgbackup.yml index 29424da..3da4245 100644 --- a/roles/ynh_backup/tasks/borgbackup.yml +++ b/roles/ynh_backup/tasks/borgbackup.yml @@ -18,7 +18,7 @@ # # #-----------------------------------------------------------------------------# - name: Download BorgBackup role on localhost - ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,v0.9.3 -p "{{ _ansible_role_directory }}" + ansible.builtin.command: ansible-galaxy install m3nu.ansible_role_borgbackup,"{{ m3nu_ansible_role_borgbackup_version }}" -p "{{ _ansible_role_directory }}" delegate_to: localhost become: False tags: