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.
57 lines
1.4 KiB
57 lines
1.4 KiB
4 years ago
|
---
|
||
|
|
||
|
- name: Create the archive dir
|
||
|
file: path={{ mayan_root_dir }}/archives/{{ mayan_current_version }} state=directory
|
||
|
tags: mayan
|
||
|
|
||
4 years ago
|
- name: Stop sevices during upgrade
|
||
|
service: name={{ item }} state=stopped
|
||
|
loop:
|
||
|
- mayan-edms-web
|
||
|
- mayan-edms-worker-fast
|
||
|
- mayan-edms-worker-medium
|
||
|
- mayan-edms-worker-slow
|
||
|
- mayan-edms-beat
|
||
|
tags: mayan
|
||
|
|
||
4 years ago
|
- name: Archive previous version
|
||
|
synchronize:
|
||
|
src: "{{ mayan_root_dir }}/{{ item }}"
|
||
|
dest: "{{ mayan_root_dir }}/archives/{{ mayan_current_version }}/"
|
||
|
recursive: True
|
||
|
delete: True
|
||
|
loop:
|
||
|
- venv
|
||
4 years ago
|
- config
|
||
4 years ago
|
delegate_to: "{{ inventory_hostname }}"
|
||
|
tags: mayan
|
||
|
|
||
|
- name: Dump the database
|
||
|
mysql_db:
|
||
|
state: dump
|
||
|
name: "{{ mayan_db_name }}"
|
||
4 years ago
|
target: "{{ root_dir }}/archives/{{ mayan_current_version }}/{{ mayan_db_name }}.sql.gz"
|
||
4 years ago
|
login_host: "{{ mayan_db_server }}"
|
||
|
login_user: sqladmin
|
||
|
login_password: "{{ mysql_admin_pass }}"
|
||
|
quick: True
|
||
|
single_transaction: True
|
||
4 years ago
|
when: mayan_db_engine == 'mysql'
|
||
|
tags: mayan
|
||
|
|
||
|
- name: Dump the database
|
||
|
command: >
|
||
3 years ago
|
/usr/pgsql-14/bin/pg_dump
|
||
4 years ago
|
--clean
|
||
3 years ago
|
--create
|
||
4 years ago
|
--host={{ mayan_db_server | quote }}
|
||
|
--port={{ mayan_db_port | quote }}
|
||
|
--username=sqladmin {{ mayan_db_name | quote }}
|
||
4 years ago
|
--file="{{ mayan_root_dir }}/archives/{{ mayan_current_version }}/{{ mayan_db_name }}.sql"
|
||
4 years ago
|
environment:
|
||
4 years ago
|
- PGPASSWORD: "{{ pg_admin_pass }}"
|
||
|
when: mayan_db_engine == 'postgresql'
|
||
4 years ago
|
tags: mayan
|
||
|
|
||
4 years ago
|
|