parent
09f75c740c
commit
5d3e11225d
8 changed files with 70 additions and 1 deletions
@ -0,0 +1,10 @@ |
||||
--- |
||||
|
||||
- name: Compress previous version |
||||
command: tar cf {{ synapse_root_dir }}/archives/{{ synapse_current_version }}.tar.zst --use-compress-program=zstd ./ |
||||
args: |
||||
chdir: "{{ synapse_root_dir }}/archives/{{ synapse_current_version }}" |
||||
warn: False |
||||
environment: |
||||
ZSTD_CLEVEL: 10 |
||||
tags: matrix |
@ -0,0 +1,30 @@ |
||||
--- |
||||
|
||||
- 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 |
||||
command: > |
||||
/usr/pgsql-13/bin/pg_dump |
||||
--clean |
||||
--host={{ synapse_pg_db_server }} |
||||
--port={{ synapse_pg_db_port }} |
||||
--username=sqladmin {{ synapse_pg_db_name }} |
||||
--file={{ synapse_root_dir }}/archives/{{ synapse_current_version }}/{{ synapse_pg_db_name }}.sql |
||||
environment: |
||||
- PGPASSWORD: "{{ pg_admin_pass }}" |
||||
tags: matrix |
@ -0,0 +1,5 @@ |
||||
--- |
||||
|
||||
- name: Write current version |
||||
copy: content={{ synapse_version }} dest={{ synapse_root_dir }}/meta/ansible_version |
||||
tags: matrix |
Loading…
Reference in new issue