mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
fix(monitoring): exporter firewall rules
This commit is contained in:
parent
4d1a542384
commit
6fb140c7e6
1 changed files with 8 additions and 0 deletions
|
|
@ -4,6 +4,11 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.attrsets) attrValues;
|
||||
inherit (lib.lists) concatMap toList;
|
||||
allExporters = let
|
||||
exporters = removeAttrs config.services.prometheus.exporters [ "unifi-poller" ];
|
||||
in concatMap toList (attrValues exporters);
|
||||
in {
|
||||
config = {
|
||||
services.prometheus.exporters = {
|
||||
|
|
@ -52,5 +57,8 @@ in {
|
|||
}
|
||||
];
|
||||
};
|
||||
networking.firewall.interfaces.lan.allowedTCPPorts = map (exporter:
|
||||
mkIf (exporter.enable && !exporter.openFirewall) 999
|
||||
) allExporters;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue