Compare commits
4 Commits
6a3f5612f4
...
36234baae7
Author | SHA1 | Date |
---|---|---|
Starbeamrainbowlabs | 36234baae7 | |
Starbeamrainbowlabs | 8b29c6f50b | |
Starbeamrainbowlabs | 3eb80707cf | |
Starbeamrainbowlabs | aa309ec60e |
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
if ! mountpoint -q /mnt/shared; then mount /mnt/shared; fi
|
||||
if ! mountpoint -q /mnt/elfstone; then mount /mnt/elfstone; fi
|
||||
if ! mountpoint -q /mnt/elessar-music; then mount /mnt/elessar-music; fi
|
||||
if ! mountpoint -q /mnt/elessar-syncthing; then mount /mnt/elessar-syncthing; fi
|
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "[job/nfs] Checking NFS mounts" >&2;
|
||||
|
||||
# _netdev The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system)
|
||||
# nofail Do not report errors for this device if it does not exist.
|
||||
# auto Auto-mount on boot
|
||||
# noatime No last-access time
|
||||
# tcp Use tcp, not udp
|
||||
# bg The system won't block during boot until it is able to mount the filesystem, but won't give up on trying to mount it either.
|
||||
# timeo=VALUE The time in deciseconds (tenths of a second) the NFS client waits for a response before it retries an NFS request.
|
||||
# retrans=n The number of times the NFS client retries a request before it attempts further recovery action.
|
||||
|
||||
|
||||
if [[ ! -d /mnt/shared ]]; then
|
||||
echo "[job/nfs] Creating mount for shared cluster data" >&2;
|
||||
sudo mkdir -p /mnt/shared;
|
||||
echo 'magicbag.node.mooncarrot.space:/mnt/elfstone2/cluster /mnt/shared nfs auto,nofail,noatime,_netdev,tcp,bg,timeo=50,retrans=5 0 0' | sudo tee -a /etc/fstab;
|
||||
sudo mount /mnt/shared;
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -d /mnt/elfstone ]]; then
|
||||
echo "[job/nfs] Creating mount for elfstone" >&2;
|
||||
sudo mkdir -p /mnt/elfstone;
|
||||
echo 'magicbag.node.mooncarrot.space:/mnt/elfstone2/main /mnt/elfstone nfs auto,nofail,noatime,_netdev,tcp,bg,timeo=50,retrans=5 0 0' | sudo tee -a /etc/fstab;
|
||||
sudo mount /mnt/elfstone;
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -d /mnt/elessar-music ]]; then
|
||||
echo "[job/nfs] Creating mount for elessar-music" >&2;
|
||||
sudo mkdir -p /mnt/elessar-music;
|
||||
echo 'magicbag.node.mooncarrot.space:/mnt/elfstone2/syncthing/Music /mnt/elessar-music nfs auto,nofail,_netdev,noatime,tcp,bg,timeo=50,retrans=5 0 0' | sudo tee -a /etc/fstab;
|
||||
sudo mount /mnt/elessar-music;
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -d /mnt/elessar-syncthing ]]; then
|
||||
echo "[job/nfs] Creating mount for elessar-syncthing" >&2;
|
||||
sudo mkdir -p /mnt/elessar-syncthing;
|
||||
echo 'magicbag.node.mooncarrot.space:/mnt/elfstone2/syncthing /mnt/elessar-syncthing nfs auto,nofail,_netdev,noatime,tcp,bg,timeo=50,retrans=5 0 0' | sudo tee -a /etc/fstab;
|
||||
sudo mount /mnt/elessar-syncthing;
|
||||
fi
|
||||
|
||||
echo "[job/nfs] Complete" >&2;
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
RUN "sudo apt-get update";
|
||||
RUN "sudo apt-get install --yes nfs-common";
|
||||
|
||||
SCRIPT "${JOBFILE_DIR}/nfs-setup.sh"
|
||||
|
||||
COPY "${JOBFILE_DIR}/cluster-shared-nfs" "/tmp/cluster-shared-nfs";
|
||||
RUN "sudo mv /tmp/cluster-shared-nfs /etc/network/if-up.d/cluster-shared-nfs";
|
||||
RUN "sudo chown root:root /etc/network/if-up.d/cluster-shared-nfs";
|
||||
RUN "sudo chmod +x /etc/network/if-up.d/cluster-shared-nfs"
|
11
src/run.sh
11
src/run.sh
|
@ -66,6 +66,17 @@ ask_password() {
|
|||
whiptail --title "${title}" --passwordbox "${question}" 10 40 "${default_text}" 3>&1 1>&2 2>&3;
|
||||
return "$?"; # Not actually needed, but best to be explicit
|
||||
}
|
||||
ask_multichoice() {
|
||||
local title="$1"; shift;
|
||||
local args=();
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
args+=("$1");
|
||||
args+=("$1");
|
||||
shift;
|
||||
done
|
||||
whiptail --nocancel --notags --menu "$title" 15 40 5 "${args[@]}" 3>&1 1>&2 2>&3;
|
||||
return "$?"; # Not actually needed, but best to be explicit
|
||||
}
|
||||
|
||||
queue_postinstall_step() {
|
||||
local stepname="$1";
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
consul_mode="$(ask_multichoice "Consul installation mode" "none" "client" "server")";
|
||||
|
||||
if [[ "${consul_mode}" != "none" ]]; then
|
||||
queue_apt_install "hashicorp-consul";
|
||||
if [[ "${consul_mode}" == "client" ]]; then
|
||||
queue_apt_install "hashicorp-consul-systemd-client";
|
||||
else
|
||||
queue_apt_install "hashicorp-consul-systemd-server";
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue