From 321791e809fc7f5b37d2ba6e90c9841e324caa2d Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 22 Jul 2024 00:21:55 +0200 Subject: [PATCH] cluster/services/frangiclave: retry_join --- cluster/services/frangiclave/server.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cluster/services/frangiclave/server.nix b/cluster/services/frangiclave/server.nix index f09806d..538b4dc 100644 --- a/cluster/services/frangiclave/server.nix +++ b/cluster/services/frangiclave/server.nix @@ -1,4 +1,4 @@ -{ cluster, config, depot, ... }: +{ cluster, config, depot, lib, ... }: let apiLink = cluster.config.hostLinks.${config.networking.hostName}.frangiclave-server; @@ -18,6 +18,17 @@ in storageBackend = "raft"; storageConfig = /*hcl*/ '' node_id = "x${builtins.hashString "sha256" "frangiclave-node-${config.networking.hostName}"}" + ${ + lib.pipe (cluster.config.services.frangiclave.otherNodes.server config.networking.hostName) [ + (map (node: cluster.config.hostLinks.${node}.frangiclave-server)) + (map (link: /*hcl*/ '' + retry_join { + leader_api_addr = "${link.url}" + } + '')) + (lib.concatStringsSep "\n") + ] + } ''; }; }