feat: vollst. Installations-Doku, Ansible-Rollen ausimplementiert, claude_workspace-Rolle
- docs/installation.md: Netinstall + Dualboot Schritt-für-Schritt (LUKS nur am Notebook) - docs/postinstall-ansible.md: Ablauf + restmanuelle Schritte - roles/base: APT-Sources mit non-free-firmware + Backports, Locale, Tastatur, Zeitzone, Grundpakete - roles/desktop_kde: Plasma 6 + SDDM (ohne Recommends, kompakt) - roles/hardening: SSH key-only, UFW, unattended-upgrades - roles/dev_tools: Node.js via NodeSource, Python, Perl, Git-Defaults - roles/workstation_apps: Firefox, Thunderbird, LibreOffice, Codecs, KeePassXC - roles/claude_workspace (NEU): Claude Code + ccusage, SSH-Key für Gitea, Workspace-Clone (recurse-submodules), ~/.claude/settings.json - site.yml: alle Rollen mit Tags
This commit is contained in:
105
docs/installation.md
Normal file
105
docs/installation.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# Installation Debian 13 (Trixie) — Dualboot
|
||||
|
||||
Diese Anleitung gilt für alle drei Workstations (notebook, pc, werkstatt). Unterschiede sind unten markiert.
|
||||
|
||||
## 1. Vorbereitung in Windows
|
||||
|
||||
1. **Updates fertigstellen**, dann `Datenträgerverwaltung` (`diskmgmt.msc`) öffnen
|
||||
2. **BitLocker** deaktivieren auf der Partition, die verkleinert wird, sonst startet Windows nach dem GRUB-Eintrag nicht mehr sauber
|
||||
3. Windows-Partition verkleinern → freien Bereich erzeugen:
|
||||
- **Notebook:** mindestens 80 GB frei
|
||||
- **PC:** mindestens 150 GB frei
|
||||
- **Werkstatt:** mindestens 60 GB frei
|
||||
4. **Schnellstart** in Windows deaktivieren (`Energieoptionen → Auswählen, was beim Drücken …`), sonst bleibt das NTFS in einem halben Zustand und Grub kann es nicht sicher zeigen
|
||||
5. **BIOS/UEFI**:
|
||||
- Boot-Mode: UEFI (nicht Legacy)
|
||||
- **Secure Boot:** anlassen, Debian 13 unterstützt es out-of-the-box
|
||||
- Fast Boot: aus (sonst kein USB-Boot)
|
||||
|
||||
## 2. Boot-Stick erstellen
|
||||
|
||||
ISO: `firmware-13.x.x-amd64-netinst.iso` von <https://cdimage.debian.org/cdimage/firmware/>
|
||||
> Die **firmware**-Variante ist Pflicht — sonst fehlen WLAN-/Grafik-Treiber.
|
||||
|
||||
Stick (mind. 2 GB) schreiben:
|
||||
- Windows: [Rufus](https://rufus.ie) → "DD-Image" Modus
|
||||
- Linux: `sudo dd if=firmware-13.x.x-amd64-netinst.iso of=/dev/sdX bs=4M status=progress oflag=sync`
|
||||
|
||||
## 3. Debian-Installation
|
||||
|
||||
Vom Stick booten (BIOS-Boot-Menu, meist F12/F10/Esc).
|
||||
|
||||
### Wichtige Antworten im Installer
|
||||
|
||||
| Schritt | Antwort |
|
||||
|---|---|
|
||||
| Sprache | Deutsch |
|
||||
| Tastatur | Deutsch |
|
||||
| Hostname | `notebook` / `pc` / `werkstatt` |
|
||||
| Domain | `egonlebt.lan` |
|
||||
| Root-Passwort | **leer lassen** → Tom bekommt automatisch `sudo` |
|
||||
| Benutzer | Tom Egon (`tom`) |
|
||||
| Zeitzone | Europe/Berlin |
|
||||
|
||||
### Partitionierung
|
||||
|
||||
**Notebook (mit LUKS):**
|
||||
- Methode: **Geführt — gesamten Laufwerk verwenden, mit verschlüsseltem LVM**
|
||||
- Wenn der Installer die Methode wegen Windows nicht anbietet → **Manuell**:
|
||||
- ESP existiert bereits (Windows) — wiederverwenden, mountpoint `/boot/efi`
|
||||
- 1 GB unverschlüsselte `/boot` (ext4)
|
||||
- Rest: LUKS-Container → LVM:
|
||||
- `lv-root` 30 GB ext4 → `/`
|
||||
- `lv-home` Rest ext4 → `/home`
|
||||
- `lv-swap` 8 GB Swap (= RAM-Größe für Hibernate)
|
||||
|
||||
**PC + Werkstatt (ohne LUKS):**
|
||||
- Methode: **Manuell**
|
||||
- ESP wiederverwenden, mountpoint `/boot/efi`
|
||||
- 30 GB ext4 → `/`
|
||||
- Rest ext4 → `/home`
|
||||
- Swap-File statt -Partition (per `systemd` nachgereicht, einfacher)
|
||||
|
||||
### Paketauswahl (Software-Auswahl)
|
||||
|
||||
**Nur ankreuzen:**
|
||||
- ✅ SSH-Server
|
||||
- ✅ Standard-Systemwerkzeuge
|
||||
|
||||
**Abwählen:**
|
||||
- ❌ Debian-Desktop, GNOME, KDE — kommt alles über Ansible
|
||||
|
||||
So bleibt die Basis schlank (~1.2 GB).
|
||||
|
||||
### GRUB
|
||||
|
||||
- "GRUB auf primärem Laufwerk installieren" → **Ja**
|
||||
- Nach Reboot: GRUB zeigt Debian + "Windows Boot Manager"
|
||||
|
||||
## 4. Erstboot (vor Ansible)
|
||||
|
||||
Auf der Zielmaschine einloggen (Konsole), dann:
|
||||
|
||||
```bash
|
||||
# IP merken
|
||||
ip -4 addr show | grep inet
|
||||
# SSH läuft schon (Paketauswahl). Test vom Admin-Rechner:
|
||||
# ssh tom@<host>.egonlebt.lan
|
||||
```
|
||||
|
||||
Auf dem **Admin-Rechner** (Windows mit OpenSSH, oder schon installierter Linux):
|
||||
|
||||
```bash
|
||||
# Public Key kopieren — danach kein Passwort mehr nötig
|
||||
ssh-copy-id tom@notebook.egonlebt.lan
|
||||
```
|
||||
|
||||
Damit ist die Basis bereit für den Ansible-Run → `docs/postinstall-ansible.md`.
|
||||
|
||||
## 5. Sanity Checks
|
||||
|
||||
```bash
|
||||
ssh tom@notebook.egonlebt.lan 'cat /etc/debian_version' # → 13.x
|
||||
ssh tom@notebook.egonlebt.lan 'sudo -n true && echo sudo-ok'
|
||||
ssh tom@notebook.egonlebt.lan 'efibootmgr -v | grep -E "debian|Windows"'
|
||||
```
|
||||
88
docs/postinstall-ansible.md
Normal file
88
docs/postinstall-ansible.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# Postinstall via Ansible
|
||||
|
||||
Voraussetzung: Debian-Grundinstallation läuft, SSH-Login per Key funktioniert (siehe `installation.md`).
|
||||
|
||||
## 1. Ansible auf dem Admin-Rechner
|
||||
|
||||
Ansible kann von **jedem Rechner** ausgeführt werden, der die Zielmaschinen per SSH erreicht und Python 3 hat. Empfohlen: die erste fertige Linux-Workstation wird zum Admin-Rechner für die nächsten.
|
||||
|
||||
Initial vom Windows-Rechner (WSL/Git-Bash) reicht auch:
|
||||
|
||||
```bash
|
||||
# Linux/WSL
|
||||
sudo apt install -y ansible
|
||||
# oder via pipx
|
||||
pipx install ansible-core
|
||||
```
|
||||
|
||||
## 2. Ablauf
|
||||
|
||||
```bash
|
||||
cd ~/Claude/linux-workstations
|
||||
|
||||
# Verbindungstest
|
||||
ansible -i ansible/inventory.yml notebook -m ping
|
||||
|
||||
# Trockenlauf
|
||||
ansible-playbook -i ansible/inventory.yml ansible/site.yml --limit notebook --check --diff
|
||||
|
||||
# Echter Run
|
||||
ansible-playbook -i ansible/inventory.yml ansible/site.yml --limit notebook
|
||||
```
|
||||
|
||||
Die Playbook-Ausführung dauert beim ersten Mal ~20 min (KDE-Plasma-Pakete sind groß).
|
||||
|
||||
## 3. Was nach `site.yml` fertig ist
|
||||
|
||||
- Debian-Basis mit allen Updates, deutsche Locale, Zeitzone Berlin
|
||||
- KDE Plasma 6 + SDDM (Login-Manager) — Reboot fällig
|
||||
- SSH gehärtet (Key-only), UFW aktiv (nur SSH offen), `unattended-upgrades` an
|
||||
- Git, Node.js, Python, Editor, Browser, LibreOffice, Codecs
|
||||
- **Claude Code + ccusage installiert, `~/.claude/settings.json` mit Statusline gesetzt**
|
||||
- **`~/Claude` geklont (`--recurse-submodules`)**, Git-User auf `egon` konfiguriert
|
||||
- SSH-Key für Gitea generiert (`~/.ssh/id_ed25519_gitea`), `known_hosts` für `docker.egonlebt.lan:2222` vorpopuliert
|
||||
|
||||
## 4. Restmanuelle Schritte
|
||||
|
||||
Diese zwei Dinge muss man pro Maschine selbst tun — beides je 1 Minute.
|
||||
|
||||
### 4.1 SSH-Public-Key auf Gitea hochladen
|
||||
|
||||
Am Ende des Ansible-Runs zeigt die Rolle `claude_workspace` den Public-Key an. Wenn der Run schon vorbei ist:
|
||||
|
||||
```bash
|
||||
ssh tom@notebook 'cat ~/.ssh/id_ed25519_gitea.pub'
|
||||
```
|
||||
|
||||
→ in <http://docker.egonlebt.lan:3000/user/settings/keys> als neuen SSH-Key einfügen, Name z.B. `notebook-tom`.
|
||||
|
||||
Danach auf dem Zielrechner einmal:
|
||||
|
||||
```bash
|
||||
ssh -i ~/.ssh/id_ed25519_gitea -T git@docker.egonlebt.lan -p 2222
|
||||
# Antwort: "Hi there, egon! You've successfully authenticated…"
|
||||
```
|
||||
|
||||
### 4.2 Claude Code anmelden
|
||||
|
||||
Direkt am Zielrechner (oder per `ssh -t`):
|
||||
|
||||
```bash
|
||||
claude
|
||||
# → folgt dem Browser-Login-Flow einmalig
|
||||
```
|
||||
|
||||
Danach ist die Maschine voll einsatzbereit. Statusline, Hooks (Auto-Pull beim Start, Auto-Commit/Push beim Stop), MCP-Server (paperless, imap, ssh-infra) — alles aktiv, weil Konfiguration im Repo liegt.
|
||||
|
||||
## 5. Wartung
|
||||
|
||||
```bash
|
||||
# Alles aktualisieren (nur APT-Pakete + Konfig-Drift heilen):
|
||||
ansible-playbook -i ansible/inventory.yml ansible/site.yml
|
||||
|
||||
# Eine einzelne Rolle:
|
||||
ansible-playbook -i ansible/inventory.yml ansible/site.yml --tags claude_workspace
|
||||
|
||||
# Eine einzelne Maschine:
|
||||
ansible-playbook -i ansible/inventory.yml ansible/site.yml --limit werkstatt
|
||||
```
|
||||
Reference in New Issue
Block a user