mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2026-01-14 20:06:45 +01:00
fix: auto-configure ssh_command for non-default SSH keys
When users set a custom borg_ssh_key_name, the role generates the key but borgmatic wasn't configured to use it. This caused confusing behavior where the custom key was created but not used for auth. This change auto-detects when a non-default key name is used and generates the appropriate ssh_command, while keeping configs clean for users with default keys. Closes #133
This commit is contained in:
parent
a9254cbb26
commit
9525ec03be
@ -105,6 +105,9 @@ retry_wait: {{ borgmatic_retry_wait }}
|
||||
# ssh_command: ssh -i ~/.ssh/id_ed25519
|
||||
{% if borg_ssh_command %}
|
||||
ssh_command: {{ borg_ssh_command }}
|
||||
{% elif borg_ssh_key_name != 'id_' ~ borg_ssh_key_type %}
|
||||
# Auto-configured for non-default SSH key
|
||||
ssh_command: ssh -i {{ borg_ssh_key_file_path }}
|
||||
{% endif %}
|
||||
|
||||
# Umask to be used for borg create.
|
||||
|
||||
@ -106,6 +106,9 @@ storage:
|
||||
# ssh_command: ssh -i ~/.ssh/id_ed25519
|
||||
{% if borg_ssh_command %}
|
||||
ssh_command: {{ borg_ssh_command }}
|
||||
{% elif borg_ssh_key_name != 'id_' ~ borg_ssh_key_type %}
|
||||
# Auto-configured for non-default SSH key
|
||||
ssh_command: ssh -i {{ borg_ssh_key_file_path }}
|
||||
{% endif %}
|
||||
|
||||
# Umask to be used for borg create.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user