Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix-backup-borg: add ability to backup to unencrypted repositories #1754

Merged
merged 12 commits into from Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/matrix-backup-borg/defaults/main.yml
Expand Up @@ -41,7 +41,7 @@ matrix_backup_borg_encryption: repokey-blake2
matrix_backup_borg_ssh_key_private: ""

# allow unencrypted repo access
matrix_backup_borg_unknown_unencrypted_access: false
matrix_backup_borg_unknown_unencrypted_repo_access_is_ok: false

# borg ssh command with ssh key
matrix_backup_borg_storage_ssh_command: ssh -o "StrictHostKeyChecking accept-new" -i /etc/borgmatic.d/sshkey
Expand Down
10 changes: 9 additions & 1 deletion roles/matrix-backup-borg/tasks/validate_config.yml
Expand Up @@ -7,4 +7,12 @@
with_items:
- "matrix_backup_borg_ssh_key_private"
- "matrix_backup_borg_location_repositories"
- "matrix_backup_borg_storage_encryption_passphrase"
# - "matrix_backup_borg_storage_encryption_passphrase"
# when: "matrix_backup_borg_unknown_unencrypted_repo_access_is_ok == false"
# - "matrix_backup_borg_storage_encryption_passphrase"
thebiblelover7 marked this conversation as resolved.
Show resolved Hide resolved

- name: Fail if encryption passphrase is undefined unless repository is unencrypted
fail:
msg: >-
You need to define a required passphrase.
when: "matrix_backup_borg_storage_encryption_passphrase == '' and not matrix_backup_borg_encryption == 'none'"
thebiblelover7 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion roles/matrix-backup-borg/templates/config.yaml.j2
Expand Up @@ -11,7 +11,7 @@ storage:
ssh_command: {{ matrix_backup_borg_storage_ssh_command }}
archive_name_format: '{{ matrix_backup_borg_storage_archive_name_format }}'
encryption_passphrase: {{ matrix_backup_borg_storage_encryption_passphrase }}
unknown_unencrypted_repo_access_is_ok: {{ matrix_backup_borg_unknown_unencrypted_access }}
unknown_unencrypted_repo_access_is_ok: {{ matrix_backup_borg_unknown_unencrypted_repo_access_is_ok|to_json }}

retention:
keep_hourly: {{ matrix_backup_borg_retention_keep_hourly }}
Expand Down