fix(keepalived): some tweaks to keepalived

This commit is contained in:
2025-09-14 10:22:44 +02:00
parent 49760fd54d
commit 3156e92210

View File

@@ -14,11 +14,13 @@ let
{ {
ip = "192.168.88.14"; ip = "192.168.88.14";
priority = 20; priority = 20;
state = "MASTER";
} }
else if hostname == "ziggy" then else if hostname == "ziggy" then
{ {
ip = "192.168.88.12"; ip = "192.168.88.12";
priority = 10; priority = 10;
state = "BACKUP";
} }
else else
throw "No keepalived config defined for host ${hostname}"; throw "No keepalived config defined for host ${hostname}";
@@ -50,9 +52,11 @@ in
services.keepalived = { services.keepalived = {
enable = true; enable = true;
vrrpInstances.VI = { vrrpInstances.VI = {
state = _self.state;
interface = cfg.interface; interface = cfg.interface;
virtualRouterId = 69; virtualRouterId = 69;
priority = _self.priority; priority = _self.priority;
unicastSrcIp = _self.ip;
unicastPeers = peers; unicastPeers = peers;
virtualIps = [ virtualIps = [
{ {