docs: update dr workstation readiness
This commit is contained in:
@@ -27,12 +27,12 @@ $checks["ubuntu_os"] = Invoke-WslCapture -Bash "lsb_release -a 2>/dev/null || ca
|
||||
$checks["tools"] = Invoke-WslCapture -Bash "command -v borg || true; borg --version 2>/dev/null || true; command -v ssh || true; ssh -V 2>&1 || true; command -v git || true; git --version 2>/dev/null || true"
|
||||
$checks["sudo"] = Invoke-WslCapture -Bash "sudo -n true >/dev/null 2>&1 && echo sudo-noprompt-ok || echo sudo-password-needed"
|
||||
$checks["wsl_ssh_files"] = Invoke-WslCapture -Bash "ls -la ~/.ssh 2>/dev/null || true; test -f ~/dr-smoke.sh && ls -la ~/dr-smoke.sh || true"
|
||||
$checks["gitea_ssh_smoke"] = Invoke-WslCapture -Bash "GIT_SSH_COMMAND='ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes -o IdentitiesOnly=yes -o ConnectTimeout=8' git ls-remote ssh://git@192.168.178.58:222/Micha/homelab-infra.git HEAD 2>&1 | sed -n '1,5p'"
|
||||
$checks["hetzner_ssh_smoke"] = Invoke-WslCapture -Bash "ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes -o IdentitiesOnly=yes -o ConnectTimeout=8 -p 23 u565255@u565255.your-storagebox.de 'ls' 2>&1 | sed -n '1,10p'"
|
||||
$checks["github_dr_key_smoke"] = Invoke-WslCapture -Bash "GIT_SSH_COMMAND='ssh -i ~/.ssh/dr-readonly -o BatchMode=yes -o IdentitiesOnly=yes -o ConnectTimeout=8' git ls-remote git@github.com:michaelkaleschke-spec/homelab-infra.git HEAD 2>&1 | sed -n '1,5p'"
|
||||
$checks["hetzner_dr_key_smoke"] = Invoke-WslCapture -Bash "ssh -i ~/.ssh/dr-hetzner -o BatchMode=yes -o IdentitiesOnly=yes -o ConnectTimeout=8 -p 23 u565255@u565255.your-storagebox.de 'ls' 2>&1 | sed -n '1,10p'"
|
||||
|
||||
$borgInstalled = ($checks["tools"].Output -match "borg \d")
|
||||
$giteaOk = ($checks["gitea_ssh_smoke"].Output -match "HEAD")
|
||||
$hetznerOk = -not ($checks["hetzner_ssh_smoke"].Output -match "Permission denied|Connection refused|Could not")
|
||||
$githubOk = ($checks["github_dr_key_smoke"].Output -match "HEAD")
|
||||
$hetznerOk = ($checks["hetzner_dr_key_smoke"].Output -match "hetzner_borg_appdata_critical")
|
||||
$sudoNeedsPassword = ($checks["sudo"].Output -match "sudo-password-needed")
|
||||
$drSmokeExists = ($checks["wsl_ssh_files"].Output -match "dr-smoke.sh")
|
||||
|
||||
@@ -47,31 +47,29 @@ $lines += "| Check | Ergebnis |"
|
||||
$lines += "|---|---|"
|
||||
$lines += '| WSL2 Ubuntu | vorhanden (`Ubuntu 24.04`, WSL Version 2) |'
|
||||
$lines += "| SSH/Git in WSL | vorhanden |"
|
||||
$lines += "| Gitea-SSH-Smoke mit vorhandenem WSL-Key | " + ($(if ($giteaOk) { "ok" } else { "nicht ok" })) + " |"
|
||||
$lines += "| GitHub-Read-Smoke mit DR-Key | " + ($(if ($githubOk) { "ok" } else { "nicht ok" })) + " |"
|
||||
$lines += "| Borg Client | " + ($(if ($borgInstalled) { "installiert" } else { "fehlt" })) + " |"
|
||||
$lines += "| Hetzner Storage Box mit vorhandenem WSL-Key | " + ($(if ($hetznerOk) { "ok" } else { "nicht ok / separater DR-Key noetig" })) + " |"
|
||||
$lines += "| Hetzner Storage Box mit DR-Key | " + ($(if ($hetznerOk) { "ok" } else { "nicht ok" })) + " |"
|
||||
$lines += '| `~/dr-smoke.sh` | ' + ($(if ($drSmokeExists) { "vorhanden" } else { "fehlt" })) + ' |'
|
||||
$lines += "| WSL sudo ohne Passwortprompt | " + ($(if ($sudoNeedsPassword) { "nein, Operator muss Passwort eingeben" } else { "ja" })) + " |"
|
||||
$lines += ""
|
||||
$lines += "## Bewertung"
|
||||
$lines += ""
|
||||
$lines += "- Der lokale WSL2-/Ubuntu-Unterbau ist vorhanden."
|
||||
$lines += "- Der vorhandene WSL-Key kann das interne Gitea erreichen."
|
||||
$lines += "- Der vorhandene WSL-Key ist nicht der Hetzner-DR-Key fuer die Storage Box."
|
||||
$lines += '- `borgbackup` ist noch nicht installiert.'
|
||||
$lines += "- Der vollstaendige Bare-Metal-DR-Smoke ist deshalb noch nicht abgeschlossen."
|
||||
$lines += '- Die DR-Key-Arbeitskopien liegen in WSL unter `~/.ssh/dr-readonly` und `~/.ssh/dr-hetzner`.'
|
||||
$lines += "- GitHub-Read-Smoke und Hetzner-SSH-Smoke sind erfolgreich."
|
||||
$lines += '- `borgbackup` ist installiert.'
|
||||
$lines += "- Der vollstaendige Bare-Metal-DR-Smoke wartet nur noch auf die interaktive Borg-Passphrase."
|
||||
$lines += ""
|
||||
$lines += "## Naechste Operator-Schritte"
|
||||
$lines += ""
|
||||
$lines += "In Ubuntu ausfuehren:"
|
||||
$lines += ""
|
||||
$lines += '```bash'
|
||||
$lines += "sudo apt update"
|
||||
$lines += "sudo apt install -y borgbackup openssh-client"
|
||||
$lines += "borg --version"
|
||||
$lines += "bash ~/dr-smoke.sh"
|
||||
$lines += '```'
|
||||
$lines += ""
|
||||
$lines += 'Danach den offline gesicherten Hetzner-DR-Key als Arbeitskopie nach `~/.ssh/dr-hetzner` legen und `chmod 600 ~/.ssh/dr-hetzner` setzen. Anschliessend den Smoke aus `docs/DR_WORKSTATION_SETUP.md` Schritt 3-6 fahren.'
|
||||
$lines += 'Borg fragt dabei interaktiv nach der Borg-Repo-Passphrase. Diese Passphrase wurde nicht auf `baerchen` gefunden und wird bewusst nicht dauerhaft gespeichert.'
|
||||
$lines += ""
|
||||
$lines += "## Rohchecks"
|
||||
$lines += ""
|
||||
|
||||
Reference in New Issue
Block a user