Updated eployments

This commit is contained in:
2026-06-11 23:54:44 -04:00
parent 0decccfaed
commit 5dee3a2688
9 changed files with 180 additions and 10 deletions

View File

@@ -27,7 +27,8 @@ run_remote() {
local node=$1
local cmd=$2
echo " [${node}] Running command..."
sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no "$USER@$node" "echo '$PASS' | sudo -S bash -c '$cmd'"
local escaped_cmd="${cmd//\'/\'\\\'\'}"
sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no "$USER@$node" "echo '$PASS' | sudo -S bash -c '$escaped_cmd'"
}
echo "=== Phase 1: Installing Prerequisites & Creating Directories ==="
@@ -81,11 +82,16 @@ for NODE in "${ALL_NODES[@]}"; do
sed -i '/nfs_shares/d' /etc/fstab
# Add to fstab
echo 'localhost:/swarm_vols /mnt/swarm_shared glusterfs defaults,_netdev 0 0' >> /etc/fstab
# Using primary node IP with backup servers instead of localhost (required for client-only nodes)
echo '140.44.4.71:/swarm_vols /mnt/swarm_shared glusterfs defaults,_netdev,backup-volfile-servers=140.44.4.72:140.44.4.73 0 0' >> /etc/fstab
echo '$NFS_SERVER:$NFS_SHARE /mnt/nfs_shares nfs defaults,nfsvers=4,_netdev 0 0' >> /etc/fstab
# Mount them
mount -a
# Reload systemd so it recognizes the fstab changes
systemctl daemon-reload
# Mount them individually so one failure doesn't halt the other
mount /mnt/swarm_shared
mount /mnt/nfs_shares || echo 'NFS Mount Failed, continuing...'
"
done