Remove duplicate setup scripts from docs/

This commit is contained in:
Lakehouse Admin
2026-05-19 22:50:43 +02:00
parent f0c56f137c
commit e1180e14c9
2 changed files with 0 additions and 169 deletions
-61
View File
@@ -1,61 +0,0 @@
#!/usr/bin/env bash
# Bootstrap passwordless SSH on Dell ObjectScale (Luna OS).
# ObjectScale blocks root SSH until keys are installed via admin (wheel + NOPASSWD sudo).
set -euo pipefail
OBJECTSCALE_IP="${OBJECTSCALE_IP:-10.0.20.111}"
OBJECTSCALE_USER="${OBJECTSCALE_USER:-admin}"
# Lab-only: set OBJECTSCALE_PASSWORD in environment, never commit to git
OBJECTSCALE_PASSWORD="${OBJECTSCALE_PASSWORD:-Dell2026!}"
CLUSTER_KEY_SRC="${CLUSTER_KEY_SRC:-root@10.0.21.45:/root/.ssh/atc_cluster}"
SSH_OPTS=(-o StrictHostKeyChecking=no -o ConnectTimeout=10)
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
HOSTS_FILE="${REPO_ROOT}/config/hosts/atc-lab.hosts"
command -v sshpass >/dev/null || { echo "Install sshpass first"; exit 1; }
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
scp "${SSH_OPTS[@]}" "${CLUSTER_KEY_SRC}" "${CLUSTER_KEY_SRC}.pub" "$TMPDIR/" 2>/dev/null || {
scp "${SSH_OPTS[@]}" "${CLUSTER_KEY_SRC}" "$TMPDIR/atc_cluster"
scp "${SSH_OPTS[@]}" "${CLUSTER_KEY_SRC}.pub" "$TMPDIR/atc_cluster.pub"
}
CLUSTER_PUB=$(cat "$TMPDIR/atc_cluster.pub")
PVE_PUB=""
[[ -f ~/.ssh/id_rsa.pub ]] && PVE_PUB=$(cat ~/.ssh/id_rsa.pub)
echo "==> ObjectScale $OBJECTSCALE_IP (user: $OBJECTSCALE_USER)"
sshpass -p "$OBJECTSCALE_PASSWORD" ssh "${SSH_OPTS[@]}" "${OBJECTSCALE_USER}@${OBJECTSCALE_IP}" bash -s <<REMOTE
set -e
grep -qF 'atc-lakehouse-cluster' ~/.ssh/authorized_keys 2>/dev/null || echo '$CLUSTER_PUB' >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
sudo mkdir -p /root/.ssh && sudo chmod 700 /root/.ssh
echo '$CLUSTER_PUB' | sudo tee -a /root/.ssh/authorized_keys >/dev/null
REMOTE
if [[ -n "$PVE_PUB" ]]; then
sshpass -p "$OBJECTSCALE_PASSWORD" ssh "${SSH_OPTS[@]}" "${OBJECTSCALE_USER}@${OBJECTSCALE_IP}" \
"echo '$PVE_PUB' | sudo tee -a /root/.ssh/authorized_keys >/dev/null"
fi
sshpass -p "$OBJECTSCALE_PASSWORD" scp "${SSH_OPTS[@]}" \
"$TMPDIR/atc_cluster" "$TMPDIR/atc_cluster.pub" \
"${OBJECTSCALE_USER}@${OBJECTSCALE_IP}:.ssh/"
sshpass -p "$OBJECTSCALE_PASSWORD" ssh "${SSH_OPTS[@]}" "${OBJECTSCALE_USER}@${OBJECTSCALE_IP}" \
'chmod 600 ~/.ssh/atc_cluster ~/.ssh/atc_cluster.pub'
# /etc/hosts + ssh config on objectscale
sshpass -p "$OBJECTSCALE_PASSWORD" ssh "${SSH_OPTS[@]}" "${OBJECTSCALE_USER}@${OBJECTSCALE_IP}" bash -s <<REMOTE
sudo grep -q 'ATC Lakehouse lab' /etc/hosts 2>/dev/null && sudo sed -i '/# ATC Lakehouse lab/,/^$/d' /etc/hosts || true
echo '' | sudo tee -a /etc/hosts >/dev/null
echo '# ATC Lakehouse lab (managed by Lakehouse git)' | sudo tee -a /etc/hosts >/dev/null
REMOTE
grep -v '^#' "$HOSTS_FILE" | grep -v '^$' | \
sshpass -p "$OBJECTSCALE_PASSWORD" ssh "${SSH_OPTS[@]}" "${OBJECTSCALE_USER}@${OBJECTSCALE_IP}" \
'sudo tee -a /etc/hosts >/dev/null'
echo "==> Verify key-only login"
ssh -i "$TMPDIR/atc_cluster" "${SSH_OPTS[@]}" "root@${OBJECTSCALE_IP}" hostname -f
echo "ObjectScale OK"
-108
View File
@@ -1,108 +0,0 @@
#!/usr/bin/env bash
# Deploy shared ATC cluster SSH key and /etc/hosts to all reachable lab VMs.
# Run from Proxmox host (root, with SSH access to the fleet).
set -euo pipefail
CLUSTER_KEY_SRC="${CLUSTER_KEY_SRC:-root@10.0.21.45:/root/.ssh/atc_cluster}"
HOSTS=(
10.0.21.45
10.0.21.47
10.0.20.104
10.0.21.36
10.0.21.50
10.0.21.46
10.0.20.112
10.0.21.51
10.0.20.103
10.0.21.55
10.0.21.49
10.0.21.39
)
SSH_OPTS=(-o StrictHostKeyChecking=no -o ConnectTimeout=8)
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
HOSTS_FILE="${REPO_ROOT}/config/hosts/atc-lab.hosts"
TMPDIR=$(mktemp -d)
trap 'rm -rf "$TMPDIR"' EXIT
scp "${SSH_OPTS[@]}" "${CLUSTER_KEY_SRC}" "${CLUSTER_KEY_SRC}.pub" "$TMPDIR/" 2>/dev/null || {
scp "${SSH_OPTS[@]}" "${CLUSTER_KEY_SRC}" "$TMPDIR/atc_cluster"
scp "${SSH_OPTS[@]}" "${CLUSTER_KEY_SRC}.pub" "$TMPDIR/atc_cluster.pub"
}
PVE_PUB=""
[[ -f ~/.ssh/id_rsa.pub ]] && PVE_PUB=$(cat ~/.ssh/id_rsa.pub)
for ip in "${HOSTS[@]}"; do
echo "==> $ip"
scp "${SSH_OPTS[@]}" "$TMPDIR/atc_cluster" "$TMPDIR/atc_cluster.pub" "root@${ip}:/root/.ssh/" || {
echo " FAIL scp $ip"
continue
}
ssh "${SSH_OPTS[@]}" "root@${ip}" bash -s <<'REMOTE'
set -e
chmod 600 /root/.ssh/atc_cluster /root/.ssh/atc_cluster.pub
touch /root/.ssh/authorized_keys
grep -qF 'atc-lakehouse-cluster' /root/.ssh/authorized_keys 2>/dev/null || \
cat /root/.ssh/atc_cluster.pub >> /root/.ssh/authorized_keys
REMOTE
if [[ -n "$PVE_PUB" ]]; then
ssh "${SSH_OPTS[@]}" "root@${ip}" \
"grep -qF '${PVE_PUB%% *}' /root/.ssh/authorized_keys 2>/dev/null || echo '$PVE_PUB' >> /root/.ssh/authorized_keys"
fi
ssh "${SSH_OPTS[@]}" "root@${ip}" bash -s <<REMOTE
set -e
grep -q 'ATC Lakehouse lab' /etc/hosts 2>/dev/null && \
sed -i '/# ATC Lakehouse lab/,/^$/d' /etc/hosts || true
echo '# ATC Lakehouse lab (managed by Lakehouse git)' >> /etc/hosts
cat >> /etc/hosts <<'HOSTS'
$(grep -v '^#' "$HOSTS_FILE" | grep -v '^$')
HOSTS
mkdir -p /root/.ssh/config.d
cat > /root/.ssh/config.d/99-atc-lab.conf <<'CFG'
Host atc-* *.dell-atc.lan pve01 proxmox objectscale
IdentityFile ~/.ssh/atc_cluster
StrictHostKeyChecking accept-new
ConnectTimeout 5
Host atc-objectscale objectscale 10.0.20.111
User admin
Host atc-* pve01 proxmox
User root
CFG
grep -q 'config.d' /root/.ssh/config 2>/dev/null || \
printf '%s\n' 'Include config.d/*.conf' > /root/.ssh/config
chmod 600 /root/.ssh/config /root/.ssh/config.d/99-atc-lab.conf 2>/dev/null || true
grep -q '^PubkeyAuthentication yes' /etc/ssh/sshd_config 2>/dev/null || \
echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
systemctl reload sshd 2>/dev/null || service sshd reload 2>/dev/null || true
hostname -f
REMOTE
done
echo ""
echo "==> Mesh test from atc-docker01"
ssh "${SSH_OPTS[@]}" -i "$TMPDIR/atc_cluster" root@10.0.21.45 '
ok=0 fail=0
for t in atc-db01 atc-db02 atc-kafka01 atc-lake01 atc-elastic01 atc-mgt01 atc-grafana; do
if ssh -i /root/.ssh/atc_cluster -o BatchMode=yes -o ConnectTimeout=4 root@${t} hostname -f 2>/dev/null; then
ok=$((ok+1))
else
echo "FAIL ${t}"
fail=$((fail+1))
fi
done
echo "OK=${ok} FAIL=${fail}"
'
echo ""
echo "==> ObjectScale (admin bootstrap)"
if [[ -x "${REPO_ROOT}/scripts/setup/setup-objectscale-ssh.sh" ]]; then
OBJECTSCALE_PASSWORD="${OBJECTSCALE_PASSWORD:-}" "${REPO_ROOT}/scripts/setup/setup-objectscale-ssh.sh" || \
echo " ObjectScale skipped (set OBJECTSCALE_PASSWORD if needed)"
fi
echo "Done. See docs/ssh-mesh.md"