mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-04 23:57:37 +02:00
Update to 2022-07-25 16:00
This commit is contained in:
42
roles/odoo/tasks/archive_pre.yml
Normal file
42
roles/odoo/tasks/archive_pre.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
|
||||
- name: Create the archive dir
|
||||
file: path={{ odoo_root_dir }}/archives/{{ odoo_current_version }} state=directory
|
||||
tags: odoo
|
||||
|
||||
- name: Install postgresql client
|
||||
package:
|
||||
name:
|
||||
- postgresql14
|
||||
tags: odoo
|
||||
|
||||
- name: Stop the server during upgrade
|
||||
service: name=odoo-server state=stopped
|
||||
tags: odoo
|
||||
|
||||
- name: Archive previous version
|
||||
synchronize:
|
||||
src: "{{ odoo_root_dir }}/{{ item }}"
|
||||
dest: "{{ odoo_root_dir }}/archives/{{ odoo_current_version }}/"
|
||||
recursive: True
|
||||
delete: True
|
||||
compress: False
|
||||
loop:
|
||||
- venv
|
||||
- app
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
tags: odoo
|
||||
|
||||
- name: Dump the database
|
||||
command: >
|
||||
/usr/pgsql-14/bin/pg_dump
|
||||
--clean
|
||||
--create
|
||||
--host={{ odoo_db_server | quote }}
|
||||
--port={{ odoo_db_port | quote }}
|
||||
--username={{ odoo_db_user }} {{ odoo_db_name | quote }}
|
||||
--file="{{ odoo_root_dir }}/archives/{{ odoo_current_version }}/{{ odoo_db_name }}.sql"
|
||||
environment:
|
||||
- PGPASSWORD: "{{ odoo_db_pass }}"
|
||||
tags: odoo
|
||||
|
Reference in New Issue
Block a user