26 lines
720 B
YAML
26 lines
720 B
YAML
|
- name: "Backup PostgreSQL lldap database & {{ volumes['lldap_datadir'] }} directory"
|
||
|
shell: >
|
||
|
docker exec postgres
|
||
|
pg_dump -c {{ role_name }} |
|
||
|
borg create
|
||
|
--compression lzma
|
||
|
"{{ borg_repodir }}::{{ role_name }}-{now:%Y-%m-%d_%H-%M-%S}"
|
||
|
"{{ volumes['lldap_datadir'] }}"
|
||
|
-
|
||
|
--stdin-name dump_{{ role_name }}.sql
|
||
|
environment:
|
||
|
DOCKER_HOST: "{{ docker_host }}"
|
||
|
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
|