Update to 2020-09-30 20:00

master
Daniel Berteaud 4 years ago
parent e6bb6f268c
commit 2f9049e6e6
  1. 4
      roles/mayan_edms/defaults/main.yml
  2. 2
      roles/mayan_edms/tasks/directories.yml
  3. 2
      roles/mayan_edms/tasks/install.yml
  4. 4
      roles/mayan_edms/templates/post_backup.sh.j2
  5. 10
      roles/mayan_edms/templates/pre_backup.sh.j2

@ -95,3 +95,7 @@ mayan_ldap_debug: False
# 'is_superuser': 'CN=Role_Infra_Admin,OU=Roles,DC=example,DC=org', # 'is_superuser': 'CN=Role_Infra_Admin,OU=Roles,DC=example,DC=org',
# } # }
# This is a list of indexes to expose as FUSE filesystem in {{ mayan_root_dir }}/fuse
# when running the pre-backup hook
mayan_index_as_fuse:
- creation_date

@ -22,4 +22,6 @@
- path: "{{ mayan_root_dir }}/config" - path: "{{ mayan_root_dir }}/config"
group: "{{ mayan_user }}" group: "{{ mayan_user }}"
mode: 750 mode: 750
- path: "{{ mayan_root_dir }}/fuse"
mode: 700
tags: mayan tags: mayan

@ -50,7 +50,7 @@
name: name:
- postgresql-devel - postgresql-devel
- postgresql13 - postgresql13
- python-psocopg2 - python-psycopg2
when: mayan_db_engine == 'postgresql' when: mayan_db_engine == 'postgresql'
tags: mayan tags: mayan

@ -1,3 +1,7 @@
#!/bin/bash -e #!/bin/bash -e
rm -f {{ mayan_root_dir }}/backup/* rm -f {{ mayan_root_dir }}/backup/*
{% for index in mayan_index_as_fuse %}
umount {{ mayan_root_dir }}/fuse/{{ index }}
rmdir {{ mayan_root_dir }}/fuse/{{ index }}
{% endfor %}

@ -14,3 +14,13 @@ PGPASSWORD='{{ mayan_db_pass }}' /usr/pgsql-13/bin/pg_dump \
{{ mayan_db_name | quote }} | \ {{ mayan_db_name | quote }} | \
zstd -c > "{{ mayan_root_dir }}/backup/{{ mayan_db_name }}.sql.zst" zstd -c > "{{ mayan_root_dir }}/backup/{{ mayan_db_name }}.sql.zst"
{% endif %} {% endif %}
# Use FUSE to export indexes as a file tree
set -o allexport
. /opt/mayan-edms/config/.env
set +o allexport
{% for index in mayan_index_as_fuse %}
mkdir -p {{ mayan_root_dir }}/fuse/{{ index }}
{{ mayan_root_dir }}/venv/bin/python {{ mayan_root_dir }}/venv/bin/mayan-edms.py mountindex {{ index }} {{ mayan_root_dir }}/fuse/{{ index }} &
{% endfor %}

Loading…
Cancel
Save