nixos/consul: Remove the joinNodes and joinRetries options as they are now built in consul options
This commit is contained in:
parent
bd69c51ddf
commit
1938dc9b54
@ -6,11 +6,9 @@ let
|
|||||||
dataDir = "/var/lib/consul";
|
dataDir = "/var/lib/consul";
|
||||||
cfg = config.services.consul;
|
cfg = config.services.consul;
|
||||||
|
|
||||||
configOptions = {
|
configOptions = { data_dir = dataDir; } //
|
||||||
data_dir = dataDir;
|
(if cfg.webUi then { ui_dir = "${pkgs.consul.ui}"; } else { }) //
|
||||||
}
|
cfg.extraConfig;
|
||||||
// (if cfg.webUi then { ui_dir = "${pkgs.consul.ui}"; } else { })
|
|
||||||
// cfg.extraConfig;
|
|
||||||
|
|
||||||
configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" ]
|
configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" ]
|
||||||
++ cfg.extraConfigFiles;
|
++ cfg.extraConfigFiles;
|
||||||
@ -52,23 +50,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
joinNodes = mkOption {
|
|
||||||
type = types.listOf types.str;
|
|
||||||
default = [ ];
|
|
||||||
description = ''
|
|
||||||
A list of addresses of nodes which should be joined at startup if the
|
|
||||||
current node is in a left state.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
joinRetries = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
default = 10;
|
|
||||||
description = ''
|
|
||||||
The number of times to retry connecting to the join nodes.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
interface = {
|
interface = {
|
||||||
|
|
||||||
advertise = mkOption {
|
advertise = mkOption {
|
||||||
@ -219,18 +200,6 @@ in
|
|||||||
+ ''
|
+ ''
|
||||||
echo "}" >> /etc/consul-addrs.json
|
echo "}" >> /etc/consul-addrs.json
|
||||||
'';
|
'';
|
||||||
postStart = ''
|
|
||||||
# Issues joins to nodes which we statically connect to
|
|
||||||
${flip concatMapStrings cfg.joinNodes (addr: ''
|
|
||||||
for i in {0..${toString cfg.joinRetries}}; do
|
|
||||||
# Try to join the other nodes ${toString cfg.joinRetries} times before failing
|
|
||||||
consul join "${addr}" && break
|
|
||||||
sleep 1
|
|
||||||
done &
|
|
||||||
'')}
|
|
||||||
wait
|
|
||||||
exit 0
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.consul-alerts = mkIf (cfg.alerts.enable) {
|
systemd.services.consul-alerts = mkIf (cfg.alerts.enable) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user