bundles/zfs: import bundle from work repository

This commit is contained in:
Franzi 2020-08-29 21:10:59 +02:00
parent b690ae25b0
commit 4934eb46fb
Signed by: kunsi
GPG key ID: 12E3D2136B818350
11 changed files with 841 additions and 0 deletions

View file

@ -0,0 +1,26 @@
#!/bin/bash
# Written by jpaul, 2017-03
# Extended by El Pinguino, 2017-07
<%
datasetlist = sorted(node.metadata.get('zfs', {}).get('datasets', {}).items())
volumes = []
for dataset, options in datasetlist:
if options.get('mountpoint', 'none') != 'none':
volumes.append(dataset)
%>\
exitcode=0
% for volume in volumes:
if [[ "$(zfs get -Hp -o value mounted '${volume}')" != "yes" ]]
then
echo 'CRITICAL - ${volume} not mounted'
exitcode=2
fi
% endfor
if (( exitcode == 0 ))
then
echo OK
fi
exit $exitcode