mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-03 23:26:58 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
31
roles/matrix_synapse/tasks/archive_pre.yml
Normal file
31
roles/matrix_synapse/tasks/archive_pre.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
|
||||
- name: Create archive dir
|
||||
file: path={{ synapse_root_dir }}/archives/{{ synapse_current_version }} state=directory
|
||||
tags: matrix
|
||||
|
||||
- name: Archive previous version
|
||||
synchronize:
|
||||
src: "{{ synapse_root_dir }}/{{ item }}"
|
||||
dest: "{{ synapse_root_dir }}/archives/{{ synapse_current_version }}/"
|
||||
delete: True
|
||||
compress: False
|
||||
loop:
|
||||
- etc
|
||||
- res
|
||||
- venv
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
tags: matrix
|
||||
|
||||
- name: Archive a database dump
|
||||
shell: >
|
||||
/usr/pgsql-14/bin/pg_dump
|
||||
--clean
|
||||
--create
|
||||
--host={{ synapse_pg_db_server }}
|
||||
--port={{ synapse_pg_db_port }}
|
||||
--username=sqladmin {{ synapse_pg_db_name }} |
|
||||
zstd -T0 -10 -c > {{ synapse_root_dir }}/archives/{{ synapse_current_version }}/{{ synapse_pg_db_name }}.sql.zst
|
||||
environment:
|
||||
- PGPASSWORD: "{{ pg_admin_pass }}"
|
||||
tags: matrix
|
Reference in New Issue
Block a user