Ansible ins Repo migrieren und zentrale SSH-Keys in shared/ssh.
Playbooks liegen unter pve1/ansible und pve2/ansible; authorized_keys als Fragmente mit Deploy-Skript und Ziel-Matrix für Proxmox, VM 101 und CTs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
# SSH — gemeinsame authorized_keys
|
||||
|
||||
Zentraler Katalog **öffentlicher** SSH-Keys (keine Private Keys). Stand aus den Hosts exportiert — bei neuem Laptop Key in `fragments/` ergänzen, `rebuild-assembled.sh` laufen lassen.
|
||||
|
||||
## Struktur
|
||||
|
||||
```
|
||||
shared/ssh/
|
||||
├── fragments/ # Einzelne Key-Gruppen (editierbar)
|
||||
├── assembled/ # Fertige Sets pro Ziel (generiert)
|
||||
├── rebuild-assembled.sh # fragments → assembled
|
||||
└── install-authorized-keys.sh
|
||||
```
|
||||
|
||||
| Fragment | Inhalt |
|
||||
|----------|--------|
|
||||
| [fragments/admin-workstations.pub](fragments/admin-workstations.pub) | DESKTOP-H9797I1, DESKTOP-J08NPU2 |
|
||||
| [fragments/admin-laptops-extra.pub](fragments/admin-laptops-extra.pub) | L7L1S5V, OJIEMRE, x380, Security Keys |
|
||||
| [fragments/admin-mobile.pub](fragments/admin-mobile.pub) | JuiceSSH, server6, WEBTOP |
|
||||
| [fragments/host-pve1.pub](fragments/host-pve1.pub) | root@pve1 ed25519 |
|
||||
| [fragments/host-pve2.pub](fragments/host-pve2.pub) | root@pve2 (Ansible / Host-SSH) |
|
||||
| [fragments/legacy-pve1-rsa.pub](fragments/legacy-pve1-rsa.pub) | Altes RSA auf pve1 (Kommentar „root@pve2“) |
|
||||
|
||||
## Assembled Sets → Ziel
|
||||
|
||||
| Datei | Deploy auf | User |
|
||||
|-------|------------|------|
|
||||
| [assembled/proxmox-root.pub](assembled/proxmox-root.pub) | pve1 `192.168.10.5`, pve2 `192.168.10.4` | root |
|
||||
| [assembled/vm101-jean.pub](assembled/vm101-jean.pub) | VM 101 Ubuntu `192.168.10.10` | jean |
|
||||
| [assembled/pve2-lxc-root.pub](assembled/pve2-lxc-root.pub) | CT 101 docker, 109 media, 110 AIDEV (pve2) | root |
|
||||
| [assembled/authorized_keys.all.pub](assembled/authorized_keys.all.pub) | Referenz — alle Keys vereint | — |
|
||||
|
||||
### Matrix (Ist-Zustand)
|
||||
|
||||
| Host | Empfohlenes Set | Anmerkung |
|
||||
|------|-----------------|-----------|
|
||||
| root@pve1 | proxmox-root | + legacy RSA noch enthalten |
|
||||
| root@pve2 | proxmox-root | ohne legacy RSA (reicht host-pve2) |
|
||||
| jean@192.168.10.10 | vm101-jean | Ansible fish-setup nutzt jean + SSH |
|
||||
| CT 101 (docker) | pve2-lxc-root | Ansible disk-maintenance |
|
||||
| CT 109 (media) | subset: admin + OJIEMRE | aktuell nur OJIEMRE — bei Bedarf volles Set |
|
||||
| CT 110 (aidev) | pve2-lxc-root | **aktuell leer** — Keys fehlen für Ansible |
|
||||
|
||||
## Neuen Key hinzufügen
|
||||
|
||||
1. Passendes Fragment in `fragments/*.pub` editieren (eine Zeile pro Key)
|
||||
2. `./rebuild-assembled.sh`
|
||||
3. `./install-authorized-keys.sh <target>` oder manuell `cat assembled/….pub >> ~/.ssh/authorized_keys`
|
||||
|
||||
## Deploy
|
||||
|
||||
```bash
|
||||
cd /root/docu/shared/ssh
|
||||
|
||||
# Proxmox lokal
|
||||
./install-authorized-keys.sh proxmox-root
|
||||
|
||||
# Remote
|
||||
./install-authorized-keys.sh --remote root@192.168.10.4 proxmox-root
|
||||
|
||||
# VM 101
|
||||
./install-authorized-keys.sh vm101-jean
|
||||
|
||||
# CTs auf pve2 (muss auf pve2 laufen)
|
||||
./install-authorized-keys.sh pve2-lxc-root
|
||||
./install-authorized-keys.sh pve2-lxc-root --ct 101
|
||||
|
||||
# Vorschau
|
||||
./install-authorized-keys.sh --dry-run proxmox-root
|
||||
```
|
||||
|
||||
## Ansible
|
||||
|
||||
| Host | Ansible-Pfad | Keys |
|
||||
|------|--------------|------|
|
||||
| pve1 | [pve1/ansible/](../../pve1/ansible/) | jean → VM 101 |
|
||||
| pve2 | [pve2/ansible/](../../pve2/ansible/) | root@pve2 → CTs |
|
||||
|
||||
Symlink auf dem Host: `ln -sfn /root/docu/pve{1,2}/ansible /root/ansible`
|
||||
|
||||
## Hinweise
|
||||
|
||||
- **Nur Public Keys** ins Repo — niemals `id_*` ohne `.pub` oder `.git-credentials-*`
|
||||
- Zwei verschiedene `ssh-rsa … root@pve2`: aktueller Key auf pve2 vs. Legacy auf pve1 (`legacy-pve1-rsa.pub`)
|
||||
- CT 110: vor Ansible-Wartung Keys deployen (`pve2-lxc-root`)
|
||||
Reference in New Issue
Block a user