diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-04 21:55:48 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-12-04 21:55:48 +0100 |
commit | 2150e0956bbffb995e15e29dc7f5415eb9a2e1dd (patch) | |
tree | 24025843220d032676cc91ee794fabdc09592c5e /configuration.nix | |
parent | 3db6c9a5351b5a67dec18ff02dc60907eec30925 (diff) | |
download | nixcfg-2150e0956bbffb995e15e29dc7f5415eb9a2e1dd.tar.gz nixcfg-2150e0956bbffb995e15e29dc7f5415eb9a2e1dd.zip |
Nomad and consul: single region now
Diffstat (limited to 'configuration.nix')
-rw-r--r-- | configuration.nix | 14 |
1 files changed, 8 insertions, 6 deletions
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; |