Update to 2020-10-05 22:00

master
Daniel Berteaud 4 years ago
parent f5414ee42a
commit 74d8cbb396
  1. 3
      roles/mayan_edms/defaults/main.yml
  2. 16
      roles/mayan_edms/tasks/archive_pre.yml
  3. 3
      roles/mayan_edms/tasks/cleanup.yml
  4. 2
      roles/mayan_edms/tasks/directories.yml
  5. 5
      roles/mayan_edms/tasks/install.yml
  6. 2
      roles/mayan_edms/templates/mayan-edms-worker-medium.service.j2
  7. 2
      roles/mayan_edms/templates/mayan-edms-worker-slow.service.j2

@ -1,6 +1,6 @@
---
mayan_version: 3.4.17
mayan_version: 3.5
mayan_root_dir: /opt/mayan-edms
mayan_user: mayan-edms
# Should ansible handle upgrades ? If false, only initial install will be done
@ -9,6 +9,7 @@ mayan_manage_upgrade: True
# Can be mysql or postgresql
mayan_db_engine: postgresql
mayan_db_server: "{{ mysql_server | default('localhost') }}"
mayan_db_port: "{{ (mayan_db_engine == 'mysql') | ternary('3306','5432') }}"
mayan_db_user: mayanedms
mayan_db_name: mayanedms
# A random pass will be created if not defined

@ -4,6 +4,16 @@
file: path={{ mayan_root_dir }}/archives/{{ mayan_current_version }} state=directory
tags: mayan
- 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
- name: Archive previous version
synchronize:
src: "{{ mayan_root_dir }}/{{ item }}"
@ -11,8 +21,8 @@
recursive: True
delete: True
loop:
- app
- venv
- config
delegate_to: "{{ inventory_hostname }}"
tags: mayan
@ -31,12 +41,12 @@
- name: Dump the database
command: >
/usr/pgsql-12/bin/pg_dump
/usr/pgsql-13/bin/pg_dump
--clean
--host={{ mayan_db_server | quote }}
--port={{ mayan_db_port | quote }}
--username=sqladmin {{ mayan_db_name | quote }}
--file="{{ mayan_root_dir }}/archives/server_{{ mayan_server_current_version }}/{{ mayan_db_name }}.sql"
--file="{{ mayan_root_dir }}/archives/{{ mayan_current_version }}/{{ mayan_db_name }}.sql"
environment:
- PGPASSWORD: "{{ pg_admin_pass }}"
when: mayan_db_engine == 'postgresql'

@ -2,5 +2,6 @@
- name: Remove temp and obsolete files
file: path={{ item }} state=absent
loop: []
loop:
- "{{ mayan_root_dir }}/archive"
tags: mayan

@ -15,7 +15,7 @@
- path: "{{ mayan_root_dir }}/data/mayan_settings/"
mode: 700
owner: "{{ mayan_user }}"
- path: "{{ mayan_root_dir }}/archive"
- path: "{{ mayan_root_dir }}/archives"
mode: 700
- path: "{{ mayan_root_dir }}/backup"
mode: 700

@ -67,11 +67,10 @@
pip:
name:
- pip
- redis
- redis==3.5.3
- python-ldap
- django_auth_ldap
- "{{ (mayan_db_engine == 'mysql') | ternary('mysql','psycopg2') }}"
state: "{{ (mayan_install_mode == 'none') | ternary('present', 'latest') }}"
- "{{ (mayan_db_engine == 'mysql') | ternary('mysql','psycopg2==2.8.6') }}"
virtualenv: "{{ mayan_root_dir }}/venv"
virtualenv_command: /usr/bin/virtualenv-3
virtualenv_python: /usr/bin/python3

@ -6,7 +6,7 @@ After=redis.service {{ (pg_version is defined and pg_version != 'default') | ter
User={{ mayan_user }}
WorkingDirectory={{ mayan_root_dir }}/
EnvironmentFile={{ mayan_root_dir }}/config/.env
ExecStart={{ mayan_root_dir }}/venv/bin/celery worker -A mayan -Ofair -l INFO -Q default,checkouts_periodic,indexing,signatures,documents_periodic,uploads,documents,file_metadata,metadata,sources,sources_periodic -n mayan-worker-medium.%%h --concurrency=1
ExecStart={{ mayan_root_dir }}/venv/bin/celery worker -A mayan -Ofair -l INFO -Q statistics,default,checkouts_periodic,indexing,signatures,documents_periodic,uploads,documents,file_metadata,metadata,sources,sources_periodic -n mayan-worker-medium.%%h --concurrency=1
Nice=18
PrivateTmp=yes
ProtectSystem=full

@ -6,7 +6,7 @@ After=redis.service {{ (pg_version is defined and pg_version != 'default') | ter
User={{ mayan_user }}
WorkingDirectory={{ mayan_root_dir }}/
EnvironmentFile={{ mayan_root_dir }}/config/.env
ExecStart={{ mayan_root_dir }}/venv/bin/celery worker -A mayan -Ofair -l INFO -Q statistics,tools,common_periodic,parsing,document_states,mailing,ocr -n mayan-worker-slow.%%h --concurrency=1
ExecStart={{ mayan_root_dir }}/venv/bin/celery worker -A mayan -Ofair -l INFO -Q tools,search,parsing,document_states,mailing,ocr,storage_periodic -n mayan-worker-slow.%%h --concurrency=1
Nice=19
PrivateTmp=yes
ProtectSystem=full

Loading…
Cancel
Save