Erste Version

This commit is contained in:
2025-11-12 23:18:38 +01:00
parent c58a555c07
commit 67e5ed3807
3 changed files with 530 additions and 0 deletions

40
deps.py Normal file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env python3
import shutil
import subprocess
import sys
from typing import List
REQUIRED_BINARIES = ["ansible", "ssh", "scp"]
def check_dependencies() -> List[str]:
"""Prüft, welche Binaries fehlen."""
missing = []
for binary in REQUIRED_BINARIES:
if shutil.which(binary) is None:
missing.append(binary)
return missing
def install_dependencies(missing: List[str]) -> None:
"""
Versucht, fehlende Pakete über apt zu installieren.
Achtung: sehr Debian/Raspberry-spezifisch bei Bedarf anpassen.
"""
print("Starte Installation der fehlenden Abhängigkeiten...")
cmds = []
if "ansible" in missing:
cmds.append(["sudo", "apt", "update"])
cmds.append(["sudo", "apt", "install", "-y", "ansible"])
if "ssh" in missing or "scp" in missing:
cmds.append(["sudo", "apt", "install", "-y", "openssh-client"])
for cmd in cmds:
print("", " ".join(cmd))
try:
subprocess.run(cmd, check=False)
except Exception as exc:
print(f"Fehler beim Ausführen von {' '.join(cmd)}: {exc}")
print("Abhängigkeiten-Installation abgeschlossen (ggf. Fehlerausgabe oben prüfen).")