aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md77
1 files changed, 74 insertions, 3 deletions
diff --git a/README.md b/README.md
index 6dff957..9d21794 100644
--- a/README.md
+++ b/README.md
@@ -420,10 +420,81 @@ For hosts with multiple repos, each repository has its own entry:
### Deprovisioning Borg Repositories
-This role does not currently handle deprovisioning or removing repositories.
-Deprovisioning must be done manually or via separate playbooks.
+Remove a repository's configuration without deleting the backup data:
-### Removing a Repository
+```yaml
+- role: kliwniloc.borgbackup
+ vars:
+ borg_server_host: borg-server
+ borg_repo_name: my-backup
+ state: absent
+```
+
+This will not delete the repository data on the backup server.
+
+#### Deleting Repository Data
+
+To also delete the repository data on the backup server:
+
+```yaml
+- role: kliwniloc.borgbackup
+ vars:
+ borg_server_host: borg-server
+ borg_repo_name: my-backup
+ state: absent
+ borg_dangerously_delete_backups: true # WARNING destructive!
+```
+
+> [!WARNING]
+> `borg_dangerously_delete_backups: true` permanently deletes all backup data
+> from the server. Use with caution.
+
+#### Multi-Instance Considerations
+
+When removing one repository from a multi-instance setup:
+
+- Shared SSH keys (`borg_ssh_key_per_repo: false`) are kept
+- `authorized_keys` is updated to remove only the deleted repo restriction
+- Other repositories remain unaffected
+
+Example - Remove one repo from multi-instance:
+
+```yaml
+- role: kliwniloc.borgbackup
+ vars:
+ borg_server_host: borg-server
+ borg_repo_name: configs
+ borg_backup_argument: configs
+ state: absent
+ # Other repos using same SSH key will continue to work
+```
+
+#### Limitations
+
+The following components are **NOT** removed by `state: absent`:
+
+| Component | Reason |
+| -------------------------------- | ------------------------------------------ |
+| `borgbackup` package | May be required by other backups or system |
+| Server user (`borg_server_user`) | May be used by other backup clients |
+| Server home directory | Contains other repositories |
+| Shared SSH keys | Other repos still depend on them |
+| SSH known_hosts entries | May be used for other purposes |
+
+#### Per-Repo SSH Key Behavior
+
+When `borg_ssh_key_per_repo: true`:
+
+- The specific SSH key for the repo is deleted
+- The corresponding `authorized_keys` line is removed
+
+When `borg_ssh_key_per_repo: false`:
+
+- Shared SSH key is kept
+- `authorized_keys` line is updated to remove repo restriction
+- If the deleted repo is the last one, the entire line is removed
+
+### Manual Deprovisioning
To remove a specific repository (applies to both single and multi-instance setups):