finished staging

This commit is contained in:
root
2026-03-24 09:34:37 +00:00
parent 4a3bf5af33
commit 80d2d3a03a
24 changed files with 25 additions and 1007707 deletions

25
stages/stage0-remote-run.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
ssh_keyfile='/export/home/cloudian/cloudian-installation-key'
script='/tmp/nmd/nmd-md5sum-manifest/stages/stage1-gather-node-manifest.sh'
# Ensure environment variables are set
if [[ -z "$ssh_keyfile" || -z "$script" ]]; then
echo "Error: Please set 'ssh_keyfile' and 'script' environment variables."
exit 1
fi
# Extract hostnames/IPs from /etc/hosts, skipping comments and localhost
HOSTS=$(grep -v '^#' /etc/hosts | grep -v 'localhost' | awk '{print $2}')
for HOST in $HOSTS; do
echo "--- Executing on: $HOST ---"
# Run the local script on the remote host using bash -s
# -i: Uses the specified ssh_keyfile
# -o StrictHostKeyChecking=no: Prevents the script from hanging on new host prompts
ssh -i "$ssh_keyfile" -o StrictHostKeyChecking=no "$HOST" "bash -s" < "$script"
# The loop naturally waits for the SSH command to finish before the next iteration
echo "--- Finished: $HOST ---"
done