[EVO] Permettre la restauration au déploiement
This commit is contained in:
parent
8bca43d8dc
commit
0fc8eb6a4b
@ -70,6 +70,12 @@ Phrase de passe de chiffrement de la sauvegarde.
|
||||
|
||||
*<span style="text-decoration: underline">Valeur par défaut:</span> aucune*
|
||||
|
||||
### borgmatic_restore_first
|
||||
|
||||
Booléen permettant de restaurer une sauvegarde au déploiement du rôle.
|
||||
|
||||
*<span style="text-decoration: underline">Valeur par défaut:</span> `false`*
|
||||
|
||||
## Exemples
|
||||
|
||||
### host_vars/host1.ykn.local
|
||||
|
@ -31,3 +31,5 @@ borgmatic_retention:
|
||||
borgmatic_name: "{{ inventory_hostname }}_{now}"
|
||||
borgmatic_compression: none
|
||||
borgmatic_passphrase: ""
|
||||
|
||||
borgmatic_restore_first: false
|
||||
|
@ -6,3 +6,6 @@
|
||||
|
||||
- name: Importer les tâches de configuration
|
||||
ansible.builtin.import_tasks: configuration.yml
|
||||
|
||||
- name: Importer les tâches de restauration
|
||||
ansible.builtin.import_tasks: restore.yml
|
||||
|
10
tasks/restore.yml
Normal file
10
tasks/restore.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
# tasks file for borgmatic
|
||||
|
||||
- name: Restaurer la sauvegarde la plus récente la sauvegarde la plus récente
|
||||
ansible.builtin.command:
|
||||
cmd: borgmatic extract --archive latest --path {{ directory }}
|
||||
chdir: "{{ directory }}"
|
||||
removes: "{{ directory }}"
|
||||
when: borgmatic_restore_first
|
||||
loop: "{{ borgmatic_source_directories }}"
|
Loading…
Reference in New Issue
Block a user