Fix traefik routes functions

main
kalle 2025-02-03 17:05:55 +01:00
parent 35bfc55356
commit a900c1931f
2 changed files with 8 additions and 6 deletions

View File

@ -6,15 +6,18 @@
traefikRoutes = traefikRoutes =
{ {
hostname, host,
config,
... ...
}: }:
let
hostname = host.hostname;
config = host.config.sonarr;
in
[ [
{ {
name = "${hostname}-sonarr"; name = "${hostname}-sonarr";
rule = "Host(`${config.sonarr.domain}`)"; rule = "Host(`${config.domain}`)";
target = "http://${config.ip}:8989"; target = "http://${host.ip}:8989";
} }
]; ];

View File

@ -29,8 +29,7 @@
concatMap ( concatMap (
role: role:
role.traefikRoutes { role.traefikRoutes {
inherit hostname; host = hosts.${hostname};
config = hosts.${hostname}.config;
} }
) hosts.${hostname}.roles ) hosts.${hostname}.roles
) (builtins.attrNames hosts); ) (builtins.attrNames hosts);