- orchestrate-deploy.sh: read nodes from inventory/topology.yaml instead of hardcoded list - orchestrate-deploy.sh: LTE nodes (chelsty-infra, chelsty-ha) use ConnectTimeout=30, non-fatal on failure - deploy-node.sh: service discovery falls back to services.yaml if no services.txt - deploy-node.sh: override path corrected to hosts/<node>/runtime/<service>/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1 KiB
Bash
Executable file
31 lines
1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# orchestrate-deploy.sh - To be run on SATURN
|
|
# Triggers deployment on remote execution nodes via inventory.
|
|
|
|
set -e
|
|
|
|
REPO_PATH="${HOME}/homelab-codex-ws"
|
|
USER="oskar"
|
|
|
|
while IFS=' ' read -r HOST TAG; do
|
|
echo ">>> Triggering deployment on ${HOST}..."
|
|
if [[ "$TAG" == "lte" ]]; then
|
|
ssh -o ConnectTimeout=30 "${USER}@${HOST}" "bash ~/homelab-codex-ws/scripts/deploy/deploy-node.sh" || \
|
|
echo "WARNING: Deployment on ${HOST} failed or timed out (LTE/intermittent node, skipping)"
|
|
else
|
|
ssh "${USER}@${HOST}" "bash ~/homelab-codex-ws/scripts/deploy/deploy-node.sh"
|
|
fi
|
|
done < <(python3 -c "
|
|
import yaml, sys
|
|
with open('${REPO_PATH}/inventory/topology.yaml') as f:
|
|
data = yaml.safe_load(f)
|
|
skip = {'saturn', 'solaria'}
|
|
for name, info in (data.get('nodes') or {}).items():
|
|
if name in skip:
|
|
continue
|
|
uplink = ((info or {}).get('connectivity') or {}).get('uplink', '')
|
|
print(name, 'lte' if uplink == 'lte' else 'standard')
|
|
")
|
|
|
|
echo ">>> All deployments triggered."
|