elasticsearch: support version 6

This commit is contained in:
happysalada 2021-09-17 01:18:09 +09:00 committed by Raphael Megzari
parent 2b65a74aba
commit b51e813153

View File

@ -5,13 +5,13 @@ with lib;
let
cfg = config.services.elasticsearch;
es7 = builtins.compareVersions cfg.package.version "7" >= 0;
esConfig = ''
network.host: ${cfg.listenAddress}
cluster.name: ${cfg.cluster_name}
${lib.optionalString cfg.single_node ''
discovery.type: single-node
gateway.auto_import_dangling_indices: true
''}
${lib.optionalString cfg.single_node "discovery.type: single-node"}
${lib.optionalString (cfg.single_node && es7) "gateway.auto_import_dangling_indices: true"}
http.port: ${toString cfg.port}
transport.port: ${toString cfg.tcp_port}