mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-12 00:03:17 +02:00
41 lines
903 B
YAML
41 lines
903 B
YAML
---
|
|
|
|
- name: Create the archive dir
|
|
file:
|
|
path: "{{ n8n_root_dir }}/archives/{{ n8n_current_version }}"
|
|
state: directory
|
|
tags: n8n
|
|
|
|
- name: Archive previous version
|
|
synchronize:
|
|
src: "{{ n8n_root_dir }}/{{ item }}"
|
|
dest: "{{ n8n_root_dir }}/archives/{{ n8n_current_version }}"
|
|
recursive: True
|
|
delete: True
|
|
compress: False
|
|
loop:
|
|
- app
|
|
- etc
|
|
- data
|
|
delegate_to: "{{ inventory_hostname }}"
|
|
tags: n8n
|
|
|
|
- name: Install postgresql
|
|
package: name=postgresql16
|
|
tags: n8n
|
|
|
|
- name: Backup the database
|
|
command: >
|
|
/usr/pgsql-16/bin/pg_dump
|
|
--format=custom
|
|
--clean
|
|
--create
|
|
--host={{ n8n_db_server }}
|
|
--port={{ n8n_db_port }}
|
|
--username={{ n8n_db_user }}
|
|
{{ n8n_db_name }}
|
|
--file={{ n8n_root_dir }}/archives/{{ n8n_current_version }}/{{ n8n_db_name }}.sqlc
|
|
environment:
|
|
- PGPASSWORD: "{{ n8n_db_pass }}"
|
|
tags: n8n
|