2022-01-26 18:00:05 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Create the archive dir
|
|
|
|
file: path={{ taiga_root_dir }}/archives/{{ taiga_current_version }} state=directory
|
|
|
|
tags: taiga
|
|
|
|
|
|
|
|
- name: Install postgresql client
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- postgresql14
|
|
|
|
tags: taiga
|
|
|
|
|
2022-01-28 00:00:19 +01:00
|
|
|
- name: Stop services during upgrade
|
|
|
|
service: name={{ item }} state=stopped
|
|
|
|
loop:
|
|
|
|
- taiga-back
|
|
|
|
- taiga-async
|
|
|
|
- taiga-events
|
|
|
|
- taiga-protected
|
|
|
|
when: taiga_install_mode == 'upgrade'
|
|
|
|
tags: taiga
|
|
|
|
|
2022-01-26 18:00:05 +01:00
|
|
|
- name: Archive previous version
|
|
|
|
synchronize:
|
|
|
|
src: "{{ taiga_root_dir }}/{{ item }}"
|
|
|
|
dest: "{{ taiga_root_dir }}/archives/{{ taiga_current_version }}/"
|
|
|
|
recursive: True
|
|
|
|
delete: True
|
|
|
|
compress: False
|
|
|
|
loop:
|
|
|
|
- venv
|
|
|
|
- app
|
|
|
|
delegate_to: "{{ inventory_hostname }}"
|
|
|
|
tags: taiga
|
|
|
|
|
|
|
|
- name: Dump the database
|
|
|
|
command: >
|
|
|
|
/usr/pgsql-14/bin/pg_dump
|
|
|
|
--clean
|
|
|
|
--create
|
|
|
|
--host={{ taiga_db_server | quote }}
|
|
|
|
--port={{ taiga_db_port | quote }}
|
|
|
|
--username={{ taiga_db_user | quote }} {{ taiga_db_name | quote }}
|
|
|
|
--file="{{ taiga_root_dir }}/archives/{{ taiga_current_version }}/{{ taiga_db_name }}.sql"
|
|
|
|
environment:
|
|
|
|
- PGPASSWORD: "{{ taiga_db_pass }}"
|
|
|
|
tags: taiga
|
|
|
|
|