smeserver-koji/koji-setup/koji-deploy-nfs-server.sh

51 lines
1.0 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
set -e
DEBUG=
SILENT="-s"
QUIET="-q"
for param in $1 $2 ; do
if [ $param ] ; then
case $param in
debug )
DEBUG="debug" ;;
esac
else
break
fi
done
if [ $DEBUG ] ; then
2023-09-04 08:49:28 +02:00
set -xe
SILENT=
QUIET="-v"
fi
# load required parameters
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
if [ ! -f "$SCRIPT_DIR"/koji-parameters.sh ] ; then
echo "$SCRIPT_DIR/koji-parameters.sh NOT found - aborting"
exit 1
fi
source "$SCRIPT_DIR"/koji-parameters.sh
2023-11-16 04:59:21 +01:00
# Install nfs-utils
if [[ -z $(dnf list installed | grep nfs-utils) ]] ; then
dnf install -y nfs-utils $QUIET
fi
# Export server directory to be mounted by clients - add script will add clients
2023-11-16 04:59:21 +01:00
echo $KOJI_DIR >> /etc/exports
# allow nfs usage in selinux and firewall
setsebool -P httpd_use_nfs=1
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --reload
systemctl enable --now rpcbind
systemctl enable --now nfs-server