🚀: new NAS

This commit is contained in:
VC
2024-10-26 10:07:10 +02:00
parent ca6a0cbb9e
commit 21be1afeac
21 changed files with 143 additions and 43 deletions

View File

@@ -1,11 +1,4 @@
---
restic_path: "/usr/local/bin/restic"
restic_script_path: "/usr/local/bin/resticbackup.sh"
restic_cache_dir: ""
# use in cases when cron is not available
restic_external_scheduler: false
restic_pass: !vault |
$ANSIBLE_VAULT;1.1;AES256
62333166623737363731663766353330633335306532306366356536376232396664376430613434
@@ -17,4 +10,3 @@ restic_backup_path: ["/srv", "/home", "/etc"]
restic_backup_excluded_path: ["/srv/NOBACKUP"]
restic_backup_hour: 6
restic_backup_minute: 0
restic_exe_group: "root"

View File

@@ -16,13 +16,4 @@
path: "{{ restic_path }}"
mode: "0o755"
owner: root
group: "{{ restic_exe_group }}"
- name: Create cache dir
ansible.builtin.file:
name: "{{ restic_cache_dir }}"
state: directory
owner: root
group: "{{ restic_exe_group }}"
mode: "0o700"
when: restic_cache_dir | length > 0
group: root

View File

@@ -8,7 +8,7 @@
src: resticbackup.sh.j2
dest: "{{ restic_script_path }}"
owner: root
group: "{{ restic_exe_group }}"
group: root
mode: "0o750"
- name: Cron backup script

View File

@@ -7,7 +7,7 @@ export AWS_ACCESS_KEY_ID="{{ restic_aws_access_key_id }}"
export AWS_SECRET_ACCESS_KEY="{{ restic_aws_secret_access_key }}"
## lancement de la sauvegarde
{{ restic_path }} backup {% if restic_cache_dir | length > 0 %}--cache-dir {{ restic_cache_dir }}{% endif %} --exclude-caches {% for i in restic_backup_excluded_path %} -e {{ i }} {% endfor %} {% for i in restic_backup_path %}{{ i }} {% endfor %}
{{ restic_path }} backup --exclude-caches {% for i in restic_backup_excluded_path %} -e {{ i }} {% endfor %} {% for i in restic_backup_path %}{{ i }} {% endfor %}
## récupération de l'espace
{{ restic_path }} forget --prune -d 7 -w 4 -m 3 -y 1

View File

@@ -1,4 +1,6 @@
---
restic_path: "/usr/local/bin/restic"
restic_script_path: "/usr/local/bin/resticbackup.sh"
restic_version: "0.17.1"
restic_architecture: "amd64"
restic_system: "{{ ansible_facts['system'] | lower }}"