2024-07-06 11:21:23 +02:00
|
|
|
- name: "Backup PostgreSQL vaultwarden database"
|
|
|
|
shell: >
|
|
|
|
docker exec postgres
|
|
|
|
pg_dump -c {{ role_name }} |
|
|
|
|
borg create
|
|
|
|
--compression lzma
|
|
|
|
"{{ borg_repodir }}::{{ role_name }}-{now:%Y-%m-%d_%H-%M-%S}"
|
|
|
|
-
|
|
|
|
--stdin-name dump_{{ role_name }}.sql
|
|
|
|
environment:
|
|
|
|
DOCKER_HOST: "{{ docker_host }}"
|
|
|
|
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
2024-02-22 19:09:43 +01:00
|
|
|
become: true
|
|
|
|
|
2024-07-06 11:21:23 +02:00
|
|
|
- name: Prune borg repository
|
|
|
|
command:
|
|
|
|
cmd: |
|
|
|
|
borg prune
|
|
|
|
--glob-archives='{{ role_name }}-*'
|
|
|
|
{{ borg_prune_options }}
|
|
|
|
{{ borg_repodir }}
|
|
|
|
environment:
|
|
|
|
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
|
|
|
become: true
|