create folder for gluster and add check-fuse-mount
This commit is contained in:
parent
a637f1e244
commit
f8604697f9
10
gluster/check-fuse-mounts/check-fuse-mounts.service
Normal file
10
gluster/check-fuse-mounts/check-fuse-mounts.service
Normal 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
|
||||||
19
gluster/check-fuse-mounts/check-fuse-mounts.sh
Normal file
19
gluster/check-fuse-mounts/check-fuse-mounts.sh
Normal 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
|
||||||
8
gluster/check-fuse-mounts/check-fuse-mounts.timer
Normal file
8
gluster/check-fuse-mounts/check-fuse-mounts.timer
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Check Fuse Mounts and remount them if needed.
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*:0/5
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
38
gluster/check-fuse-mounts/check-fuse-mounts.yml
Normal file
38
gluster/check-fuse-mounts/check-fuse-mounts.yml
Normal 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
|
||||||
Loading…
Reference in New Issue
Block a user