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.
39 lines
994 B
39 lines
994 B
4 years ago
|
---
|
||
|
|
||
|
- name: Create the archive dir
|
||
|
file: path={{ papermerge_root_dir }}/archives/{{ papermerge_current_version }} state=directory
|
||
|
tags: ged
|
||
|
|
||
|
- name: Stop sevices during upgrade
|
||
|
service: name={{ item }} state=stopped
|
||
|
loop:
|
||
|
- papermerge-web
|
||
|
- papermerge-worker
|
||
|
tags: ged
|
||
|
|
||
|
- name: Archive previous version
|
||
|
synchronize:
|
||
|
src: "{{ papermerge_root_dir }}/{{ item }}"
|
||
|
dest: "{{ papermerge_root_dir }}/archives/{{ papermerge_current_version }}/"
|
||
|
recursive: True
|
||
|
delete: True
|
||
|
loop:
|
||
|
- venv
|
||
|
- app
|
||
|
delegate_to: "{{ inventory_hostname }}"
|
||
|
tags: ged
|
||
|
|
||
|
- name: Dump the database
|
||
|
command: >
|
||
|
/usr/pgsql-13/bin/pg_dump
|
||
|
--clean
|
||
|
--host={{ papermerge_db_server | quote }}
|
||
|
--port={{ papermerge_db_port | quote }}
|
||
|
--username=sqladmin {{ papermerge_db_name | quote }}
|
||
|
--file="{{ papermerge_root_dir }}/archives/{{ papermerge_current_version }}/{{ papermerge_db_name }}.sql"
|
||
|
environment:
|
||
|
- PGPASSWORD: "{{ pg_admin_pass }}"
|
||
|
tags: ged
|
||
|
|
||
|
|