From d835b2cae8abc71958b69362162e6a70c3d7ef63 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 08:48:59 +0200 Subject: Adding upstream version 4.6.0. Signed-off-by: Daniel Baumann --- scripts/sbd-device/main.yml | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 scripts/sbd-device/main.yml (limited to 'scripts/sbd-device/main.yml') diff --git a/scripts/sbd-device/main.yml b/scripts/sbd-device/main.yml new file mode 100644 index 0000000..27fe8d0 --- /dev/null +++ b/scripts/sbd-device/main.yml @@ -0,0 +1,63 @@ +# Copyright (C) 2016 Kristoffer Gronlund +# +# License: GNU General Public License (GPL) +version: 2.2 +category: Script +shortdesc: "Create SBD Device" +longdesc: | + Optional step to initialize and configure the SBD Device. + + Prerequisites: + + * The environment must have shared storage reachable by all nodes. + +parameters: + - name: device + shortdesc: Shared Storage Device + example: /dev/disk/by-id/... + required: true + type: string + + - name: watchdog + shortdesc: Watchdog Device + value: /dev/watchdog + type: string + +actions: + - shortdesc: Verify configuration + sudo: true + call: | + #!/bin/sh + set -e + systemctl is-active --quiet sbd && { echo "ERROR: SBD daemon is already running"; exit 1; } || true + test -b "{{device}}" || { echo "ERROR: Not a device: {{device}"; exit 1; } + lsmod | egrep "(wd|dog)" || { echo "ERROR: No watchdog kernel module loaded"; exit 1; } + test -c "{{watchdog}}" || { echo "ERROR: Not a device: {{watchdog}}"; exit 1; } + + - shortdesc: Initialize the SBD device + sudo: true + nodes: local + call: | + #!/bin/sh + sbd dump &> /dev/null || sbd -d "{{device}}" create + # sbd allocate "$(uname -n)" # FIXME + + - shortdesc: Verify SBD Device + call: | + #!/bin/sh + sbd -d "{{device}}" list + + - shortdesc: Configure SBD Daemon + sudo: true + call: | + #!/bin/sh + [ -f "/etc/sysconfig/sbd" ] && rm -f /etc/sysconfig/sbd || true + < /etc/sysconfig/sbd + + - shortdesc: Enable SBD Daemon + service: + - sbd: start -- cgit v1.2.3