mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
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";
|
||||
cfg = config.services.consul;
|
||||
|
||||
configOptions = {
|
||||
data_dir = dataDir;
|
||||
}
|
||||
// (if cfg.webUi then { ui_dir = "${pkgs.consul.ui}"; } else { })
|
||||
// cfg.extraConfig;
|
||||
configOptions = { data_dir = dataDir; } //
|
||||
(if cfg.webUi then { ui_dir = "${pkgs.consul.ui}"; } else { }) //
|
||||
cfg.extraConfig;
|
||||
|
||||
configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" ]
|
||||
++ 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 = {
|
||||
|
||||
advertise = mkOption {
|
||||
@ -219,18 +200,6 @@ in
|
||||
+ ''
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user