From 2150e0956bbffb995e15e29dc7f5415eb9a2e1dd Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 4 Dec 2021 21:55:48 +0100 Subject: Nomad and consul: single region now --- configuration.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'configuration.nix') diff --git a/configuration.nix b/configuration.nix index a73a6eb..e2fbe3b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -217,24 +217,26 @@ in services.consul.extraConfig = let public_ip = (builtins.head (builtins.split "/" (builtins.head node_config.networking.wireguard.interfaces.wg0.ips))); in + (if node_config.services.consul.extraConfig.server or false + then { bootstrap_expect = 3; } + else {}) // { - server = true; + datacenter = "staging"; ui = true; bind_addr = public_ip; addresses.http = "0.0.0.0"; retry_join = [ "10.42.0.2" "10.42.0.21" "10.42.0.22" "10.42.0.23" ]; - retry_join_wan = [ "10.42.0.2" "10.42.0.21" "10.42.0.22" "10.42.0.23" ]; }; services.nomad.enable = true; services.nomad.settings = let public_ip = (builtins.head (builtins.split "/" (builtins.head node_config.networking.wireguard.interfaces.wg0.ips))); in + (if node_config.services.nomad.settings.server.enabled or false + then { server = { bootstrap_expect = 3; }; } + else {}) // { - region = site_config.services.nomad.settings.datacenter; - server = { - enabled = true; - }; + region = "staging"; advertise = { rpc = public_ip; http = public_ip; -- cgit v1.2.3