Files
the-custodian/infra/fleet-mesh/install-railiance01.sh
codex cf4be716e1 CUST-WP-0054 T01-T03: fleet architecture, de-hub runbook, drain plan
Documents the three-machine role model, fleet mesh topology, coulombcore
freeze policy, and ordered drain sequence. Adds railiance01 systemd tunnel
install assets and refreshes ops service inventory to reflect 2026-07-03
production placement (cluster State Hub, fleet mesh, draining coulombcore).
2026-07-04 00:29:55 +02:00

26 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install fleet-mesh systemd user units on railiance01 (CUST-WP-0054-T02).
set -euo pipefail
REMOTE="${1:-railiance01}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ssh "$REMOTE" 'mkdir -p ~/.config/bridge ~/.config/systemd/user ~/.ssh'
scp "$SCRIPT_DIR/railiance01-tunnels.yaml" "$REMOTE:~/.config/bridge/tunnels.yaml"
scp "$SCRIPT_DIR/systemd/"*.service "$REMOTE:~/.config/systemd/user/"
scp "${HOME}/.ssh/id_ops" "${HOME}/.ssh/id_ops.pub" "$REMOTE:~/.ssh/"
ssh "$REMOTE" 'chmod 600 ~/.ssh/id_ops ~/.config/bridge/tunnels.yaml'
ssh "$REMOTE" 'sudo loginctl enable-linger tegwick 2>/dev/null || true'
ssh "$REMOTE" bash -s <<'EOF'
set -euo pipefail
systemctl --user daemon-reload
systemctl --user enable --now fleet-state-hub-coulombcore.service
systemctl --user enable --now fleet-issue-core-coulombcore.service
sleep 2
curl -sf http://127.0.0.1:18000/state/health
curl -sf http://127.0.0.1:18765/healthz
systemctl --user --no-pager status fleet-state-hub-coulombcore.service fleet-issue-core-coulombcore.service
EOF
echo "Fleet mesh tunnels active on $REMOTE"