elk7: init at 7.0.0
This adds the following new packages: + elasticsearch7 + elasticsearch7-oss + logstash7 + logstash7-oss + kibana7 + kibana7-oss + filebeat7 + heartbeat7 + metricbeat7 + packetbeat7 + journalbeat7 The default major version of the ELK stack stays at 6. We should probably set it to 7 in a next commit.
This commit is contained in:
@@ -5,6 +5,9 @@ with lib;
|
||||
let
|
||||
cfg = config.services.kibana;
|
||||
|
||||
ge7 = builtins.compareVersions cfg.package.version "7" >= 0;
|
||||
lt6_6 = builtins.compareVersions cfg.package.version "6.6" < 0;
|
||||
|
||||
cfgFile = pkgs.writeText "kibana.json" (builtins.toJSON (
|
||||
(filterAttrsRecursive (n: v: v != null) ({
|
||||
server.host = cfg.listenAddress;
|
||||
@@ -16,6 +19,7 @@ let
|
||||
kibana.defaultAppId = cfg.defaultAppId;
|
||||
|
||||
elasticsearch.url = cfg.elasticsearch.url;
|
||||
elasticsearch.hosts = cfg.elasticsearch.hosts;
|
||||
elasticsearch.username = cfg.elasticsearch.username;
|
||||
elasticsearch.password = cfg.elasticsearch.password;
|
||||
|
||||
@@ -67,9 +71,30 @@ in {
|
||||
|
||||
elasticsearch = {
|
||||
url = mkOption {
|
||||
description = "Elasticsearch url";
|
||||
default = "http://localhost:9200";
|
||||
type = types.str;
|
||||
description = ''
|
||||
Elasticsearch url.
|
||||
|
||||
Defaults to <literal>"http://localhost:9200"</literal>.
|
||||
|
||||
Don't set this when using Kibana >= 7.0.0 because it will result in a
|
||||
configuration error. Use <option>services.kibana.elasticsearch.hosts</option>
|
||||
instead.
|
||||
'';
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
};
|
||||
|
||||
hosts = mkOption {
|
||||
description = ''
|
||||
The URLs of the Elasticsearch instances to use for all your queries.
|
||||
All nodes listed here must be on the same cluster.
|
||||
|
||||
Defaults to <literal>[ "http://localhost:9200" ]</literal>.
|
||||
|
||||
This option is only valid when using kibana >= 6.6.
|
||||
'';
|
||||
default = null;
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
};
|
||||
|
||||
username = mkOption {
|
||||
@@ -143,6 +168,19 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
assertions = [
|
||||
{
|
||||
assertion = ge7 -> cfg.elasticsearch.url == null;
|
||||
message =
|
||||
"The option services.kibana.elasticsearch.url has been removed when using kibana >= 7.0.0. " +
|
||||
"Please use option services.kibana.elasticsearch.hosts instead.";
|
||||
}
|
||||
{
|
||||
assertion = lt6_6 -> cfg.elasticsearch.hosts == null;
|
||||
message =
|
||||
"The option services.kibana.elasticsearch.hosts is only valid for kibana >= 6.6.";
|
||||
}
|
||||
];
|
||||
systemd.services.kibana = {
|
||||
description = "Kibana Service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
Reference in New Issue
Block a user