infrastructure:bootstrap
This is an old revision of the document!
Table of Contents
Bootstrap Guide
Komplettanleitung zum Aufbau des Automation Stacks von Grund auf. Wir haben hier als Standard-Fall die Installation im lokalen Netzwerk dokumentiert. Parallel teste ich aber auch auf einem preiswerten VPS auf Hetzner im Projekt mxmlabs-test, daher manchmal wo notwendig Abweichungen.
Übersicht
DAY 0 (manuell) DAY 1 (automatisiert) DAY 2 ───────────────── ───────────────────── ────────── Proxmox bootstrap.sh Operations UniFi Netzwerk └─► LXCs erstellen • Monitoring Cloudflare └─► Services deployen • Backups vault.yml └─► Secrets migrieren • Updates
DAY 0 — Foundation
Netzwerk
UniFi
VLAN anlegen:
| VLAN | Name | Subnet | Gateway |
|---|---|---|---|
| 160 | Server | 10.100.160.0/23 | 10.100.161.254 |
Firewall-Regeln:
| Regel | Von | Nach | Port | Aktion |
|---|---|---|---|---|
| WAN-HTTP | WAN | 10.100.161.102 | 80,443 | Allow |
| VPN-Server | 192.168.7.0/24 | 10.100.160.0/23 | * | Allow |
| Server-LAN | 10.100.160.0/23 | LAN | * | Allow |
Port-Forwarding:
| Extern | Intern | Service |
|---|---|---|
| 80 | 10.100.161.102:80 | Traefik HTTP |
| 443 | 10.100.161.102:443 | Traefik HTTPS |
Cloudflare
Domain hinzufügen:
- home.miskam.xyz → Cloudflare DNS
API Token erstellen:
- My Profile → API Tokens → Create Token
- Template: “Edit zone DNS”
- Zone: home.miskam.xyz
- → Token speichern für vault.yml
DNS Records:
| Type | Name | Value |
|---|---|---|
| A | *.home.miskam.xyz | <WAN-IP> |
Proxmox
lokal
Installation:
- ISO von proxmox.com
- Storage: local-lvm (LXC root disks)
- Netzwerk: vmbr0 als VLAN-aware Bridge
Bridge-Konfiguration (/etc/network/interfaces):
cat > /etc/network/interfaces <<EOF
auto vmbr0
iface vmbr0 inet manual
bridge-ports enp1s0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
EOF
ifreload -a
Hetzner
cat > /etc/network/interfaces <<EOF
auto lo
iface lo inet loopback
auto eno1
#real IP address
iface nic0 inet static
address 198.51.100.5/24
gateway 198.51.100.1
auto vmbr0
#private sub network
iface vmbr0 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
EOF
ifreload -a
API Token erstellen:
- Datacenter → Permissions → API Tokens
- User: root@pam
- Token ID: ansible
- Privilege Separation: aus
- → Token speichern für vault.yml
0.4 vault.yml vorbereiten
Alle Secrets für den Bootstrap in einer Datei:
cd ansible/ cat > vault.yml.plain << 'EOF' # Proxmox vault_proxmox_api_user: "root@pam!ansible" vault_proxmox_api_token: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # Cloudflare vault_cloudflare_token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # PostgreSQL vault_postgresql_admin: "GENERATE_ME" vault_postgresql_n8n: "GENERATE_ME" vault_postgresql_vaultwarden: "GENERATE_ME" vault_postgresql_forgejo: "GENERATE_ME" # Services vault_vaultwarden_admin_token: "GENERATE_ME" vault_n8n_encryption_key: "GENERATE_ME" vault_grafana_admin: "GENERATE_ME" vault_dokuwiki_admin: "GENERATE_ME" # Bot User (für Vaultwarden nach Migration) vault_bot_email: "[email protected]" vault_bot_password: "GENERATE_ME" EOF # Secrets generieren sed -i "s/GENERATE_ME/$(openssl rand -base64 24 | tr -dc 'a-zA-Z0-9' | head -c24)/g" vault.yml.plain # Verschlüsseln ansible-vault encrypt vault.yml.plain --output vault.yml rm vault.yml.plain
DAY 1 — Bootstrap
Voraussetzungen
- Proxmox erreichbar (SSH + API)
- Netzwerk konfiguriert (VLAN 160)
- vault.yml verschlüsselt vorhanden
- Git-Repo geklont
1.1 Bootstrap starten
cd ansible/ ./bootstrap.sh # → Vault-Passwort eingeben
Ablauf (automatisch)
bootstrap.sh
│
├─► 1. Control Node (CT 103)
│ └── Ansible, Git, SSH-Key
│
├─► 2. Traefik (CT 102)
│ └── CF-Token, Wildcard-Cert
│
├─► 3. PostgreSQL (CT 110)
│ └── DBs: n8n, vaultwarden, forgejo
│
├─► 4. Vaultwarden (CT 112)
│ └── Admin-Token konfiguriert
│
├─► 5. Services (parallel)
│ ├── n8n (CT 111)
│ ├── DokuWiki (CT 113)
│ ├── Uptime Kuma (CT 114)
│ ├── Monitoring (CT 115)
│ └── Forgejo (CT 116)
│
├─► 6. Traefik-Routen
│ └── automation.yml deployen
│
├─► 7. /etc/hosts
│ └── *.srv.internal auf allen Hosts
│
├─► 8. node_exporter
│ └── Port 9100 auf allen Hosts
│
└─► 9. migrate-secrets.yml
└── vault.yml → Vaultwarden API
Container-Übersicht
| CT | Name | IP | RAM | Disk | Port |
|---|---|---|---|---|---|
| 102 | traefik | 10.100.161.102 | 512M | 2G | 80,443 |
| 103 | openclaw | 10.100.160.249 | 2G | 8G | 18789 |
| 110 | postgres | 10.100.161.110 | 1G | 8G | 5432 |
| 111 | n8n | 10.100.161.111 | 1G | 4G | 5678 |
| 112 | vaultwarden | 10.100.161.112 | 512M | 2G | 8080 |
| 113 | dokuwiki | 10.100.161.113 | 512M | 2G | 80 |
| 114 | uptime-kuma | 10.100.161.114 | 512M | 2G | 3001 |
| 115 | monitoring | 10.100.161.115 | 1G | 4G | 9090,3000 |
| 116 | forgejo | 10.100.161.116 | 512M | 4G | 3000 |
Abhängigkeiten
Proxmox + UniFi + Cloudflare
│
▼
┌─────────────────┐
│ vault.yml │
└────────┬────────┘
│
┌──────────────┼──────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Control │ │ Traefik │ │PostgreSQL│
│ Node │ │ 102 │ │ 110 │
└────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │
│ │ ▼
│ │ ┌──────────┐
│ │ │Vaultwarden│
│ │ │ 112 │
│ │ └────┬─────┘
│ │ │
│ ┌──────┴───────────┴──────┐
│ ▼ ▼ ▼ ▼ ▼
│ ┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐
│ │ n8n ││Wiki ││Kuma ││Graf.││Forge│
│ │ 111 ││ 113 ││ 114 ││ 115 ││ 116 │
│ └──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘
│ └──────┴──────┴──────┴──────┘
│ │
▼ ▼
┌────────────┐ ┌────────────┐
│ /etc/hosts │ │ Traefik │
│*.srv.intern│ │ Routes │
└────────────┘ └────────────┘
│
▼
┌─────────────────┐
│ migrate-secrets │
│ → Vaultwarden │
└─────────────────┘
DAY 2 — Operations
Nach erfolgreichem Bootstrap:
- Secrets: Vaultwarden (Bitwarden-Lookup aktiv)
- Monitoring: Prometheus + Grafana
- Git: Forgejo (lokales Repo-Mirror)
URLs
| Service | URL |
|---|---|
| n8n | https://n8n.home.miskam.xyz |
| Vaultwarden | https://vault.home.miskam.xyz |
| DokuWiki | https://wiki.home.miskam.xyz |
| Uptime Kuma | https://status.home.miskam.xyz |
| Grafana | https://monitoring.home.miskam.xyz |
| Forgejo | https://git.home.miskam.xyz |
Credentials
Alle Zugangsdaten in Vaultwarden:
- Organisation: mxmlabs
- Collection: Network Automation
Erstellt: 2026-02-07
infrastructure/bootstrap.1770634153.txt.gz · Last modified: by mxm
