From 872494a35254b5856cf2f79cd311ae0402164a36 Mon Sep 17 00:00:00 2001
From: Arthur BOUDREAULT <arthur@lydra.fr>
Date: Tue, 30 Aug 2022 11:56:16 +0200
Subject: [PATCH] refactor: add Christophe suggestions

---
 roles/ynh_backup/README-FR.md      | 12 ++++++------
 roles/ynh_backup/README.md         | 12 ++++++------
 roles/ynh_backup/defaults/main.yml |  3 +--
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/roles/ynh_backup/README-FR.md b/roles/ynh_backup/README-FR.md
index c6096ed..116d2d7 100644
--- a/roles/ynh_backup/README-FR.md
+++ b/roles/ynh_backup/README-FR.md
@@ -24,7 +24,7 @@ Nous avons intégré trois systèmes de sauvegardes différents à ce rôle Yuno
 ```yml
 ynh_backup:
   scheduled:         True
-  directory:         "/data/backup"
+  directory:         "/data/backup/local_ynh_backups"
   scheduled_hour:    "*"
   scheduled_minute:  "*/30"
   scheduled_weekday: "*"
@@ -49,7 +49,7 @@ ynh_backup:
 ```yml
 ynh_borg_backup_scheduled:  True
 borg_source_directories:    "{{ ynh_backup.directory }}"
-borg_repository:            "/data/backup/borg_repository"
+borg_repository:            "{{ ynh_backup.directory }}/borg_repository"
 borg_encryption_passphrase: "PLEASECHANGEME"
 borgmatic_config_name:      "borgmatic_ynh_config"
 borgmatic_cron_name:        "borgmatic_ynh_cron"
@@ -100,13 +100,13 @@ restic_repos:
 
 restic_backups:
   YunoHost_remote:
-    name:        "remote_ynh_restic"
-    repo:        "s3_ynh_restic_repo"
-    src:         "{{ ynh_backup.directory }}"
+    name:                   "remote_ynh_restic"
+    repo:                   "s3_ynh_restic_repo"
+    src:                    "{{ ynh_backup.directory }}"
     tags:
       - yunohost
       - remote
-    keep_within: "{{ restic_keep_time }}"
+    keep_within:            "{{ restic_keep_time }}"
     scheduled: True
     schedule_hour: 1
     schedule_minute: 0
diff --git a/roles/ynh_backup/README.md b/roles/ynh_backup/README.md
index d5011a2..d6ce924 100644
--- a/roles/ynh_backup/README.md
+++ b/roles/ynh_backup/README.md
@@ -24,7 +24,7 @@ YunoHost provides its own native backup system. It is able to back up YunoHost c
 ```yml
 ynh_backup:
   scheduled:         True
-  directory:         "/data/backup"
+  directory:         "/data/backup/local_ynh_backups"
   scheduled_hour:    "*"
   scheduled_minute:  "*/30"
   scheduled_weekday: "*"
@@ -49,7 +49,7 @@ ynh_backup:
 ```yml
 ynh_borg_backup_scheduled:  True
 borg_source_directories:    "{{ ynh_backup.directory }}"
-borg_repository:            "/data/backup/borg_repository"
+borg_repository:            "{{ ynh_backup.directory }}/borg_repository"
 borg_encryption_passphrase: "PLEASECHANGEME"
 borgmatic_config_name:      "borgmatic_ynh_config"
 borgmatic_cron_name:        "borgmatic_ynh_cron"
@@ -100,13 +100,13 @@ restic_repos:
 
 restic_backups:
   YunoHost_remote:
-    name:        "remote_ynh_restic"
-    repo:        "s3_ynh_restic_repo"
-    src:         "{{ ynh_backup.directory }}"
+    name:                   "remote_ynh_restic"
+    repo:                   "s3_ynh_restic_repo"
+    src:                    "{{ ynh_backup.directory }}"
     tags:
       - yunohost
       - remote
-    keep_within: "{{ restic_keep_time }}"
+    keep_within:            "{{ restic_keep_time }}"
     scheduled: True
     schedule_hour: 1
     schedule_minute: 0
diff --git a/roles/ynh_backup/defaults/main.yml b/roles/ynh_backup/defaults/main.yml
index b6423c7..d542202 100644
--- a/roles/ynh_backup/defaults/main.yml
+++ b/roles/ynh_backup/defaults/main.yml
@@ -34,8 +34,7 @@ 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"
-do1jlr_restic_version:       "v0.7.1"
-
 restic_keep_time:            "0y1m0d0h"
-- 
GitLab