Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
823 B

---
- 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