pkgs/gateway-report: emphasize ipv6 default router
This commit is contained in:
parent
13e0aa216e
commit
2b6bb2e423
|
@ -56,15 +56,17 @@ writeText "vlan-report.md" ''
|
|||
let
|
||||
hostConfig = config.site.hosts.${hostName};
|
||||
isDhcpDefault = hostName == netConfig.dhcp.router or null;
|
||||
emphasize = s:
|
||||
if isDhcpDefault
|
||||
then "**${s}**"
|
||||
else s;
|
||||
upstream4a = upstreamAt hostConfig.ospf.allowedUpstreams 0;
|
||||
upstream4b = upstreamAt hostConfig.ospf.allowedUpstreams 1;
|
||||
in ''
|
||||
|`${
|
||||
netConfig.hosts4.${hostName}
|
||||
}`|${
|
||||
if isDhcpDefault
|
||||
then "**${hostName}**"
|
||||
else hostName
|
||||
|${
|
||||
emphasize netConfig.hosts4.${hostName}
|
||||
}|${
|
||||
emphasize hostName
|
||||
}|${
|
||||
upstream4a
|
||||
}|${
|
||||
|
@ -86,17 +88,24 @@ writeText "vlan-report.md" ''
|
|||
${lib.concatMapStrings (hostName:
|
||||
let
|
||||
hostConfig = config.site.hosts.${hostName};
|
||||
isIpv6Router = hostName == netConfig.ipv6Router;
|
||||
emphasize = s:
|
||||
if isIpv6Router
|
||||
then "**${s}**"
|
||||
else s;
|
||||
upstream6a = upstreamAt hostConfig.ospf.allowedUpstreams6 0;
|
||||
upstream6b = upstreamAt hostConfig.ospf.allowedUpstreams6 1;
|
||||
in ''
|
||||
|${
|
||||
lib.concatMapStringsSep " " (ctx:
|
||||
"`${netConfig.hosts6.${ctx}.${hostName}}`"
|
||||
) (builtins.filter (ctx:
|
||||
netConfig.hosts6.${ctx} ? ${hostName}
|
||||
) (builtins.attrNames netConfig.hosts6))
|
||||
emphasize (
|
||||
lib.concatMapStringsSep " " (ctx:
|
||||
"`${netConfig.hosts6.${ctx}.${hostName}}`"
|
||||
) (builtins.filter (ctx:
|
||||
netConfig.hosts6.${ctx} ? ${hostName}
|
||||
) (builtins.attrNames netConfig.hosts6))
|
||||
)
|
||||
}|${
|
||||
hostName
|
||||
emphasize hostName
|
||||
}|${
|
||||
upstream6a
|
||||
}|${
|
||||
|
|
Loading…
Reference in New Issue