- keepalived: pg_role='standby' hat Vorrang vor role für BACKUP-Bestimmung - keepalived-master.sh: gecrasht Dienste beim MASTER-Übergang starten (nicht nur reload) - confighash: ip_addresses per Interface-Name hashen statt per FK (Cross-Node-Drift-Fix) - TOTP/2FA: RFC 6238 — Setup-Flow, QR-Code, Admin-Disable; two-step Login - Firewall-UI: Enterprise-Design — auto-Beschreibung, icon-only Actions, zero-hit Indikator - fe80-Filter: Link-local IPv6 aus NTP/DNS Listen-Dropdowns entfernen - VIP-Dashboard, Dual-Path VRRP, GW-Tracking (Migrations 0033/0034) - Forward Proxy + DNS erweiterte Einstellungen (Migrations 0031/0032) - unbound-control: edgeguard in unbound-Gruppe via postinst Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
1.4 KiB
Bash
27 lines
1.4 KiB
Bash
#!/bin/bash
|
|
# Keepalived notify_master: dieser Node hat die VIP übernommen.
|
|
#
|
|
# KEIN Auto-Promote — Split-Brain-Schutz durch manuelle Promotion.
|
|
# Admin muss "edgeguard-ctl promote" ausführen wenn PG-Failover gewünscht.
|
|
|
|
logger -t keepalived -p daemon.warning \
|
|
"MASTER: VIP übernommen — PG-Rolle ist noch '$(cat /var/lib/edgeguard/pg_role 2>/dev/null || echo standby)'. Für PG-Failover: edgeguard-ctl promote"
|
|
|
|
# Dienste reloaden/starten damit sie die neu aktiven VIPs binden.
|
|
# Squid + Unbound + HAProxy binden beim Start an spezifische IPs — war der Dienst
|
|
# während des BACKUP-Zustands gecrasht oder gestoppt, muss er gestartet werden.
|
|
for svc in squid.service unbound.service haproxy.service; do
|
|
if systemctl is-active --quiet "$svc"; then
|
|
systemctl reload "$svc" 2>/dev/null || systemctl restart "$svc" 2>/dev/null || true
|
|
else
|
|
systemctl start "$svc" 2>/dev/null || true
|
|
fi
|
|
done
|
|
logger -t keepalived -p daemon.info "MASTER: squid/unbound/haproxy reload-or-start nach VIP-Übernahme"
|
|
|
|
# Alert an die API schicken (best-effort, ignoriert Fehler)
|
|
curl -sf --max-time 3 -X POST \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"level":"warning","message":"Keepalived MASTER: VIP übernommen. Wenn PG-Failover gewünscht: edgeguard-ctl promote ausführen.","source":"keepalived"}' \
|
|
http://127.0.0.1:9443/api/v1/internal/alert > /dev/null 2>&1 || true
|