25 lines
645 B
YAML
25 lines
645 B
YAML
|
- name: Create borg backup from PostgreSQL dumpall
|
||
|
shell: |
|
||
|
docker exec postgres
|
||
|
pg_dumpall |
|
||
|
borg create
|
||
|
--compression lzma
|
||
|
"{{ borg_repodir }}::{{ role_name }}-{now:%Y-%m-%d_%H-%M-%S}"
|
||
|
-
|
||
|
--stdin-name dumpall.sql
|
||
|
environment:
|
||
|
DOCKER_HOST: "unix:///run/user/{{ host_uid }}/docker.sock"
|
||
|
BORG_PASSCOMMAND: "cat {{ borg_passphrase_file }}"
|
||
|
become: true
|
||
|
|
||
|
- 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
|