aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-08-24 14:23:17 +0200
committerAlex Auvolat <alex@adnab.me>2022-08-24 14:23:17 +0200
commitec2020b71bb877d113c8fd8e75dc2a529ebb16b5 (patch)
treeb1f64938fd17008bc372fc47e704d902b3739509 /nix
parent468c6b702bf5700d23970401ffb79f7776a7d037 (diff)
downloadnixcfg-ec2020b71bb877d113c8fd8e75dc2a529ebb16b5.tar.gz
nixcfg-ec2020b71bb877d113c8fd8e75dc2a529ebb16b5.zip
Disable bootstrap_expect unless specific deuxfleurs.bootstrap is set
Diffstat (limited to 'nix')
-rw-r--r--nix/deuxfleurs.nix20
1 files changed, 11 insertions, 9 deletions
diff --git a/nix/deuxfleurs.nix b/nix/deuxfleurs.nix
index 7c2919c..0b5169f 100644
--- a/nix/deuxfleurs.nix
+++ b/nix/deuxfleurs.nix
@@ -117,6 +117,11 @@ in
description = "List of users having an admin account on cluster nodes, maps user names to a list of authorized SSH keys";
type = types.attrsOf (types.listOf types.str);
};
+ bootstrap = mkOption {
+ description = "Whether to enable bootstrapping for Nomad and Consul";
+ type = types.bool;
+ default = false;
+ };
};
config = {
@@ -187,10 +192,8 @@ in
services.consul.enable = true;
services.consul.extraConfig =
(if cfg.is_raft_server
- then {
- server = true;
- bootstrap_expect = 3;
- }
+ then { server = true; }
+ // (if cfg.bootstrap then { bootstrap_expect = 3; } else {})
else {}) //
{
datacenter = cfg.cluster_name;
@@ -235,11 +238,10 @@ in
];
services.nomad.settings =
(if cfg.is_raft_server
- then { server = {
- enabled = true;
- bootstrap_expect = 3;
- }; }
- else {}) //
+ then {
+ server = { enabled = true; }
+ // (if cfg.bootstrap then { bootstrap_expect = 3; } else {});
+ } else {}) //
{
region = cfg.cluster_name;
datacenter = cfg.site_name;