clanServices: add deprecation warning to monitoring service settings.

This commit is contained in:
Qubasa
2025-09-19 01:54:13 +02:00
parent 455268f6ce
commit d6ae9cde3f
3 changed files with 16 additions and 22 deletions

View File

@@ -10,15 +10,15 @@
{ lib, ... }:
{
options.allowAllInterfaces = lib.mkOption {
type = lib.types.bool;
default = false;
description = "If true, Telegraf will listen on all interfaces. Otherwise, it will only listen on the interfaces specified in `interfaces`";
type = lib.types.nullOr lib.types.bool;
default = null;
description = "Deprecated. Has no effect.";
};
options.interfaces = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "zt+" ];
description = "List of interfaces to expose the metrics to";
type = lib.types.nullOr (lib.types.listOf lib.types.str);
default = null;
description = "Deprecated. Has no effect.";
};
};
};

View File

@@ -14,20 +14,17 @@
auth_user = "prometheus";
in
{
warnings =
lib.optionals (settings.allowAllInterfaces != null) [
"monitoring.settings.allowAllInterfaces is deprecated and and has no effect. Please remove it from your inventory."
"The monitoring service will now always listen on all interfaces over https."
]
++ (lib.optionals (settings.interfaces != null) [
"monitoring.settings.interfaces is deprecated and and has no effect. Please remove it from your inventory."
"The monitoring service will now always listen on all interfaces over https."
]);
networking.firewall.interfaces = lib.mkIf (settings.allowAllInterfaces == false) (
builtins.listToAttrs (
map (name: {
inherit name;
value.allowedTCPPorts = [
9273
9990
];
}) settings.interfaces
)
);
networking.firewall.allowedTCPPorts = lib.mkIf (settings.allowAllInterfaces == true) [
networking.firewall.allowedTCPPorts = [
9273
9990
];

View File

@@ -14,9 +14,6 @@
module.input = "self";
roles.telegraf.machines.peer1 = { };
roles.telegraf.settings = {
allowAllInterfaces = true;
};
};
};
};