mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-16 10:13:26 +02:00
Update to 2022-08-30 23:00
This commit is contained in:
parent
2bb38da306
commit
f460decd9b
@ -42,3 +42,10 @@
|
|||||||
systemd: daemon_reload=True
|
systemd: daemon_reload=True
|
||||||
when: linctl_unit.changed or (linctl_data_unit is defined and linctl_data_unit.changed)
|
when: linctl_unit.changed or (linctl_data_unit is defined and linctl_data_unit.changed)
|
||||||
tags: drbd
|
tags: drbd
|
||||||
|
|
||||||
|
- name: Install backup hooks
|
||||||
|
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/linstor mode=755
|
||||||
|
loop:
|
||||||
|
- pre
|
||||||
|
- post
|
||||||
|
tags: drbd
|
||||||
|
8
roles/linstor_controller/templates/post-backup.j2
Normal file
8
roles/linstor_controller/templates/post-backup.j2
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
if [[ -e /home/lbkp/linstor/linstor_backup.zip ]]; then
|
||||||
|
echo Removing Linstor DB dump /home/lbkp/linstor/linstor_backup.zip
|
||||||
|
rm -f /home/lbkp/linstor/linstor_backup.zip
|
||||||
|
fi
|
18
roles/linstor_controller/templates/pre-backup.j2
Normal file
18
roles/linstor_controller/templates/pre-backup.j2
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
mkdir -p /home/lbkp/linstor/
|
||||||
|
|
||||||
|
{% if linctl_ha %}
|
||||||
|
# Check we are the current active node. Else, just skip the backup
|
||||||
|
if [[ ! -e /var/lib/linstor/linstordb.mv.db ]]; then
|
||||||
|
echo Linstor DB not available on this node, skipping backup
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
echo Dumping linstor DB dump
|
||||||
|
linstor controller backupdb linstor_backup
|
||||||
|
echo Moving dump to /home/lbkp/linstor/linstor_backup.zip
|
||||||
|
mv /var/lib/linstor/linstor_backup.zip /home/lbkp/linstor/
|
Loading…
x
Reference in New Issue
Block a user