ansible-roles/roles/taiga/tasks/archive_pre.yml

53 lines
1.3 KiB
YAML
Raw Normal View History

2022-01-26 18:00:05 +01:00
---
2022-01-29 13:00:05 +01:00
- name: Set archive dir name
set_fact: taiga_archive_dir=back_{{ taiga_version_back }}-front_{{ taiga_version_front }}-events_{{ taiga_version_events }}-protected_{{ taiga_version_protected }}
tags: taiga
2022-01-26 18:00:05 +01:00
- name: Create the archive dir
2022-01-29 13:00:05 +01:00
file: path={{ taiga_root_dir }}/archives/{{ taiga_archive_dir }} state=directory
2022-01-26 18:00:05 +01:00
tags: taiga
- name: Install postgresql client
package:
name:
2024-01-04 17:00:34 +01:00
- postgresql16
2022-01-26 18:00:05 +01:00
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 }}"
2022-01-29 13:00:05 +01:00
dest: "{{ taiga_root_dir }}/archives/{{ taiga_archive_dir }}/"
2022-01-26 18:00:05 +01:00
recursive: True
delete: True
compress: False
loop:
- venv
- app
delegate_to: "{{ inventory_hostname }}"
tags: taiga
- name: Dump the database
command: >
2024-01-04 17:00:34 +01:00
/usr/pgsql-16/bin/pg_dump
2022-01-26 18:00:05 +01:00
--clean
--create
--host={{ taiga_db_server | quote }}
--port={{ taiga_db_port | quote }}
--username={{ taiga_db_user | quote }} {{ taiga_db_name | quote }}
2022-01-29 13:00:05 +01:00
--file="{{ taiga_root_dir }}/archives/{{ taiga_archive_dir }}/{{ taiga_db_name }}.sql"
2022-01-26 18:00:05 +01:00
environment:
- PGPASSWORD: "{{ taiga_db_pass }}"
tags: taiga