♻️: migrate from core to scale

This commit is contained in:
VC
2024-10-17 11:15:26 +02:00
parent ee72fe9ad0
commit 73e2c209e0
5 changed files with 19 additions and 8 deletions

View File

@@ -1,14 +1,17 @@
--- ---
restic_path: "/mnt/tank/restic/restic"
restic_script_path: "/mnt/tank/restic/resticbackup.sh"
restic_cache_dir: "/mnt/tank/restic/cache"
restic_backup_path: restic_backup_path:
- /mnt/tank - /mnt/tank
restic_backup_excluded_path: restic_backup_excluded_path:
- /mnt/tank/ix-applications
- /mnt/tank/s3/.minio.sys - /mnt/tank/s3/.minio.sys
- /mnt/tank/iocage - /mnt/tank/restic/cache
restic_backup_hour: 6 restic_backup_hour: 6
restic_backup_minute: 45 restic_backup_minute: 45
ansible_python_interpreter: /usr/local/bin/python3
restic_aws_access_key_id: "SCW0VAFXE5MN9N8KVHTQ" restic_aws_access_key_id: "SCW0VAFXE5MN9N8KVHTQ"
restic_aws_secret_access_key: !vault | restic_aws_secret_access_key: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256

View File

@@ -1,4 +1,7 @@
--- ---
restic_path: "/usr/local/bin/restic"
restic_script_path: "/usr/local/bin/resticbackup.sh"
restic_cache_dir: ""
restic_pass: !vault | restic_pass: !vault |
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256

View File

@@ -17,3 +17,12 @@
mode: "0o755" mode: "0o755"
owner: root owner: root
group: "{{ restic_exe_group }}" 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

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 }}" export AWS_SECRET_ACCESS_KEY="{{ restic_aws_secret_access_key }}"
## lancement de la sauvegarde ## lancement de la sauvegarde
{{ restic_path }} backup --exclude-caches {% for i in restic_backup_excluded_path %} -e {{ i }} {% endfor %} {% for i in restic_backup_path %}{{ i }} {% endfor %} {{ 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 %}
## récupération de l'espace ## récupération de l'espace
{{ restic_path }} forget --prune -d 7 -w 4 -m 3 -y 1 {{ restic_path }} forget --prune -d 7 -w 4 -m 3 -y 1

View File

@@ -1,11 +1,7 @@
--- ---
restic_version: "0.17.1" restic_version: "0.17.1"
restic_architecture: "amd64" restic_architecture: "amd64"
restic_system: "{{ ansible_facts['system'] | lower }}" restic_system: "{{ ansible_facts['system'] | lower }}"
restic_download_url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_{{ restic_system }}_{{ restic_architecture }}.bz2" restic_download_url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_{{ restic_system }}_{{ restic_architecture }}.bz2"
restic_path: "/usr/local/bin/restic"
restic_script_path: "/usr/local/bin/resticbackup.sh"
restic_repository: "s3:{{ restic_s3_url }}/{{ inventory_hostname }}" restic_repository: "s3:{{ restic_s3_url }}/{{ inventory_hostname }}"