[FIX] Configurer le client ssh

This commit is contained in:
pulsar89.5 2023-05-26 17:20:21 +02:00
parent 809240330c
commit d0065c98dc
5 changed files with 13 additions and 9 deletions

View File

@ -70,12 +70,6 @@ Phrase de passe de chiffrement de la sauvegarde.
*<span style="text-decoration: underline">Valeur par défaut:</span> aucune*
### borgmatic_ssh_command
Commande SSH utilisée pour la sauvegarde.
*<span style="text-decoration: underline">Valeur par défaut:</span> `ssh -i /etc/borgmatic/id_ed25519`*
## Exemples
### host_vars/host1.ykn.local

View File

@ -23,4 +23,3 @@ borgmatic_retention:
borgmatic_name: "{{ inventory_hostname }}_{now}"
borgmatic_compression: none
borgmatic_passphrase: ""
borgmatic_ssh_command: ssh -i /etc/borgmatic/id_ed25519

View File

@ -3,7 +3,7 @@
- name: Créer le dépôt
ansible.builtin.command:
cmd: borgmatic init --encryption repokey
cmd: borgmatic init --encryption repokey-blake2
become: true
- name: Activer la planification

View File

@ -19,6 +19,18 @@
mode: u=rw,g=r,o=r
become: true
- name: Déployer la configuration de SSH
ansible.builtin.blockinfile:
path: /root/.ssh/config
marker: "# {mark} ANSIBLE MANAGED BLOCK for role_borgmatic"
block: |
{% for repository in borgmatic_repositories %}
Host {{ repository | split('@') | last | split('/') | first }}
IdentityFile /etc/borgmatic/id_ed25519
IdentitiesOnly yes
{% endfor %}
become: true
- name: Déployer la configuration
ansible.builtin.template:
src: config.yaml.j2

View File

@ -22,4 +22,3 @@ storage:
archive_name_format: {{ borgmatic_name }}
compression: {{ borgmatic_compression }}
encryption_passphrase: {{ borgmatic_passphrase }}
ssh_command: {{ borgmatic_ssh_command }}