Add NFS, but it's not *quite* finished yet
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 2 seconds
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 2 seconds
we still need to auto-generate the cluster-shared-nfs script and perhaps rename it
This commit is contained in:
parent
6cf5496c69
commit
612dbf96b7
4 changed files with 30 additions and 0 deletions
|
@ -40,6 +40,7 @@ fi
|
|||
version="$(git rev-parse HEAD)";
|
||||
last_version="";
|
||||
if [[ -r "/etc/sbrl-provisioning-commitid.txt" ]]; then
|
||||
#shellcheck disable=SC2034
|
||||
last_version="$(cat "/etc/sbrl-provisioning-commitid.txt")";
|
||||
fi
|
||||
|
||||
|
|
3
src/steps-config/15-nfs.sh
Normal file
3
src/steps-config/15-nfs.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
queue_apt_install "nfs-common";
|
|
@ -10,6 +10,7 @@ subtask_end "$?";
|
|||
|
||||
# If there's an existing config file and we haven't completed provisioning at
|
||||
# least once yet, move it aside as a backup
|
||||
#shellcheck disable=SC2154
|
||||
if [[ -r "/etc/collectd/collectd.conf" ]] && [[ -z "${last_version}" ]]; then
|
||||
subtask_begin "Moving existing config file aside";
|
||||
mv "${collectd_conf_target}" "${collectd_conf_target}.bak-$(date +%Y-%m-%d)";
|
||||
|
|
25
src/steps-postinstall/20-nfs.sh
Normal file
25
src/steps-postinstall/20-nfs.sh
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# $1 Thing to mount
|
||||
# $2 Path to mount it to
|
||||
add_nfs_mount() {
|
||||
source="${1}";
|
||||
target="${2}";
|
||||
|
||||
task_begin "NFS mount ${source} → ${target}";
|
||||
# 1: Remove any old entries from /etc/fstab
|
||||
sed -i "/^$(echo "${source}" | awk '{gsub("/", "\\/", $0); print($0); }')\s/d" /etc/fstab
|
||||
|
||||
# 2: Append the new entry
|
||||
echo "${source} ${target} nfs auto,nofail,noatime,_netdev,tcp,bg,timeo=50,retrans=5 0 0" >>/etc/fstab;
|
||||
|
||||
# 3: Create the target mount point & mount
|
||||
mkdir -p "${target}";
|
||||
mount "${target}";
|
||||
|
||||
task_end "$?";
|
||||
}
|
||||
|
||||
add_nfs_mount "magicbag.node.mooncarrot.space:/mnt/elfstone2/cluster" "/mnt/shared";
|
||||
add_nfs_mount "magicbag.node.mooncarrot.space:/mnt/elfstone2/main /mnt/elfstone" "/mnt/elfstone";
|
||||
add_nfs_mount "magicbag.node.mooncarrot.space:/mnt/elfstone2/syncthing" "/mnt/elessar-syncthing";
|
Loading…
Reference in a new issue