create folder for gluster and add check-fuse-mount

This commit is contained in:
Thomas Gebert 2025-11-07 02:48:51 +01:00
parent a637f1e244
commit f8604697f9
5 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[Unit]
Description=Check Fuse Mounts and remount them if needed.
After=remote-fs.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/check-fuse-mounts.sh
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,19 @@
#!/bin/bash
header1 () {
cat << HEADER1
################################################################################
# ${FUSE} has an issue, trying to remount it
################################################################################
HEADER1
}
for FUSE in $(grep 'fuse.glusterfs' /proc/mounts | cut -d ' ' -f 2); do
if ! stat "${FUSE}" &> /dev/null; then
header1 "${FUSE}"
umount "${FUSE}"
sleep 1s
ls -alh "${FUSE}"
echo ""
fi
done

View File

@ -0,0 +1,8 @@
[Unit]
Description=Check Fuse Mounts and remount them if needed.
[Timer]
OnCalendar=*:0/5
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,38 @@
---
- hosts: storage_nodes
any_errors_fatal: true
tasks:
- assert:
that:
- ansible_play_hosts == ansible_play_hosts_all
- name: Copy check-fuse-mounts script
copy:
owner: root
group: root
mode: 0755
src: "check-fuse-mounts.sh"
dest: "/usr/local/sbin/check-fuse-mounts.sh"
- name: Copy check-fuse-mounts systemd service
copy:
owner: root
group: root
mode: 0644
src: "check-fuse-mounts.service"
dest: "/etc/systemd/system/check-fuse-mounts.service"
- name: Copy check-fuse-mounts systemd timer
copy:
owner: root
group: root
mode: 0644
src: "check-fuse-mounts.timer"
dest: "/etc/systemd/system/check-fuse-mounts.timer"
- name: Enable check-fuse-mounts timer
systemd:
name: check-fuse-mounts.timer
daemon_reload: true
state: started
enabled: true