1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

fix: rename influx org to machines; fix typo that prevented auth tokens from being created (organization>s<)

This commit is contained in:
oddlama 2023-12-23 15:16:22 +01:00
parent 94b0d60ab5
commit 2120aefef5
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
7 changed files with 9 additions and 9 deletions

View file

@ -28,7 +28,7 @@
scrapeSensors = false; scrapeSensors = false;
influxdb2 = { influxdb2 = {
domain = config.networking.providedDomains.influxdb; domain = config.networking.providedDomains.influxdb;
organization = "servers"; organization = "machines";
bucket = "telegraf"; bucket = "telegraf";
node = "ward-influxdb"; node = "ward-influxdb";
}; };

View file

@ -35,7 +35,7 @@
enable = true; enable = true;
influxdb2 = { influxdb2 = {
domain = nodes.sentinel.config.networking.providedDomains.influxdb; domain = nodes.sentinel.config.networking.providedDomains.influxdb;
organization = "servers"; organization = "machines";
bucket = "telegraf"; bucket = "telegraf";
node = "ward-influxdb"; node = "ward-influxdb";
}; };

View file

@ -14,7 +14,7 @@ in {
scrapeSensors = false; scrapeSensors = false;
influxdb2 = { influxdb2 = {
domain = sentinelCfg.networking.providedDomains.influxdb; domain = sentinelCfg.networking.providedDomains.influxdb;
organization = "servers"; organization = "machines";
bucket = "telegraf"; bucket = "telegraf";
node = "ward-influxdb"; node = "ward-influxdb";
}; };

View file

@ -42,7 +42,7 @@ in {
group = "influxdb2"; group = "influxdb2";
}; };
services.influxdb2.provision.organization.servers.auths."grafana servers:telegraf (${config.node.name})" = { services.influxdb2.provision.organizations.machines.auths."grafana machines:telegraf (${config.node.name})" = {
readBuckets = ["telegraf"]; readBuckets = ["telegraf"];
writeBuckets = ["telegraf"]; writeBuckets = ["telegraf"];
tokenFile = nodes.ward-influxdb.config.age.secrets."grafana-influxdb-token-${config.node.name}".path; tokenFile = nodes.ward-influxdb.config.age.secrets."grafana-influxdb-token-${config.node.name}".path;
@ -132,14 +132,14 @@ in {
enable = true; enable = true;
datasources.settings.datasources = [ datasources.settings.datasources = [
{ {
name = "InfluxDB (servers)"; name = "InfluxDB (machines)";
type = "influxdb"; type = "influxdb";
access = "proxy"; access = "proxy";
url = "https://${sentinelCfg.networking.providedDomains.influxdb}"; url = "https://${sentinelCfg.networking.providedDomains.influxdb}";
orgId = 1; orgId = 1;
secureJsonData.token = "$__file{${config.age.secrets.grafana-influxdb-token.path}}"; secureJsonData.token = "$__file{${config.age.secrets.grafana-influxdb-token.path}}";
jsonData.version = "Flux"; jsonData.version = "Flux";
jsonData.organization = "servers"; jsonData.organization = "machines";
jsonData.defaultBucket = "telegraf"; jsonData.defaultBucket = "telegraf";
} }
# TODO duplicate above influxdb source (with scoped read tokens??) for each organization # TODO duplicate above influxdb source (with scoped read tokens??) for each organization

View file

@ -91,7 +91,7 @@ in {
passwordFile = config.age.secrets.influxdb-admin-password.path; passwordFile = config.age.secrets.influxdb-admin-password.path;
tokenFile = config.age.secrets.influxdb-admin-token.path; tokenFile = config.age.secrets.influxdb-admin-token.path;
}; };
organizations.servers.buckets.telegraf = {}; organizations.machines.buckets.telegraf = {};
}; };
}; };

View file

@ -48,7 +48,7 @@ in {
enable = true; enable = true;
influxdb2 = { influxdb2 = {
domain = sentinelCfg.networking.providedDomains.influxdb; domain = sentinelCfg.networking.providedDomains.influxdb;
organization = "servers"; organization = "machines";
bucket = "telegraf"; bucket = "telegraf";
node = "ward-influxdb"; node = "ward-influxdb";
}; };

View file

@ -66,7 +66,7 @@ in {
group = "influxdb2"; group = "influxdb2";
}; };
services.influxdb2.provision.organization.servers.auths."telegraf (${config.node.name})" = { services.influxdb2.provision.organizations.machines.auths."telegraf (${config.node.name})" = {
readBuckets = ["telegraf"]; readBuckets = ["telegraf"];
writeBuckets = ["telegraf"]; writeBuckets = ["telegraf"];
tokenFile = nodes.${cfg.influxdb2.node}.config.age.secrets."telegraf-influxdb-token-${config.node.name}".path; tokenFile = nodes.${cfg.influxdb2.node}.config.age.secrets."telegraf-influxdb-token-${config.node.name}".path;