Update to 2020-09-28 20:00

master
Daniel Berteaud 4 years ago
parent b995cbac2d
commit ba1979fde0
  1. 11
      roles/glpi/tasks/cleanup.yml
  2. 2
      roles/glpi/tasks/directories.yml
  3. 10
      roles/glpi/tasks/install.yml
  4. 3
      roles/glpi/templates/post_backup.j2
  5. 9
      roles/glpi/templates/pre_backup.j2

@ -9,10 +9,13 @@
tags: glpi
- name: Remove temp files
file: path={{ glpi_root_dir }}/tmp/{{ item }} state=absent
file: path={{ item }} state=absent
with_items:
- glpi
- glpi-{{ glpi_version }}.tgz
- glpi.sql
- "{{ glpi_root_dir }}/tmp/glpi"
- "{{ glpi_root_dir }}/tmp/glpi-{{ glpi_version }}.tgz"
- "{{ glpi_root_dir }}/tmp/glpi.sql"
- "{{ glpi_root_dir }}/db_dumps"
- /etc/backup/pre.d/glpi_{{ glpi_id }}_dump_db
- /etc/backup/post.d/glpi_{{ glpi_id }}_rm_dump
tags: glpi

@ -8,7 +8,7 @@
- "{{ glpi_root_dir }}/tmp"
- "{{ glpi_root_dir }}/sessions"
- "{{ glpi_root_dir }}/meta"
- "{{ glpi_root_dir }}/db_dumps"
- "{{ glpi_root_dir }}/backup"
- "{{ glpi_root_dir }}/data"
- "{{ glpi_root_dir }}/data/_files"
- "{{ glpi_root_dir }}/data/_cache"

@ -122,12 +122,10 @@
tags: glpi
- name: Deploy backup scripts
template: src={{ item.script }}.j2 dest=/etc/backup/{{ item.type }}.d/glpi_{{ glpi_id }}_{{ item.script }} mode=750
with_items:
- script: dump_db
type: pre
- script: rm_dump
type: post
template: src={{ item }}_backup.j2 dest=/etc/backup/{{ item }}.d/glpi_{{ glpi_id }} mode=750
loop:
- pre
- post
tags: glpi
- name: Download the logo

@ -0,0 +1,3 @@
#!/bin/bash -e
rm -f {{ glpi_root_dir }}/backup/*

@ -0,0 +1,9 @@
#!/bin/bash -e
/usr/bin/mysqldump --user={{ glpi_mysql_user | quote }} \
--password={{ glpi_mysql_pass | quote }} \
--host={{ glpi_mysql_server | quote }} \
--quick --single-transaction \
--add-drop-table {{ glpi_mysql_db | quote }} | zstd -T0 -c > {{ glpi_root_dir }}/backup/{{ glpi_mysql_db }}.sql.zst
cp {{ glpi_root_dir }}/web/config/glpicrypt.key {{ glpi_root_dir }}/backup/
Loading…
Cancel
Save