mirror of
https://github.com/clearlinux/koji-setup-scripts.git
synced 2026-04-28 11:03:50 +00:00
When koji builder and koji master are hosted on different machines, NFS mounting is needed to connect the services. Make this process more smooth to minimize manual editing of files. Namely, change the top directory that koji looks at. If on the master, this is on the local file system. If on the builder not on the master, this is also on the local file system, but is backed by a NFS mount in a different location. Signed-off-by: George T Kramer <george.t.kramer@intel.com>
29 lines
648 B
Bash
Executable File
29 lines
648 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (C) 2019 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -xe
|
|
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
|
source "$SCRIPT_DIR"/globals.sh
|
|
source "$SCRIPT_DIR"/parameters.sh
|
|
|
|
KOJI_MOUNT_SERVICE="${KOJI_MOUNT_DIR:1}"
|
|
KOJI_MOUNT_SERVICE="${KOJI_MOUNT_SERVICE/\//-}".mount
|
|
mkdir -p /etc/systemd/system
|
|
cat > /etc/systemd/system/"$KOJI_MOUNT_SERVICE" <<- EOF
|
|
[Unit]
|
|
Description=Koji NFS Mount
|
|
After=network.target
|
|
|
|
[Mount]
|
|
What=$KOJI_MASTER_FQDN:$KOJI_DIR
|
|
Where=$KOJI_MOUNT_DIR
|
|
Type=nfs
|
|
Options=defaults,ro
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl daemon-reload
|
|
systemctl enable --now "$KOJI_MOUNT_SERVICE"
|