Added support for a DNSSEARCH netdev tag in network configuration overlays

- Closes: #1256

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-11 20:17:40 -07:00
committed by Christian Goll
parent 428b06463f
commit da26fa3061
14 changed files with 314 additions and 244 deletions

View File

@@ -50,7 +50,7 @@ gateway={{ $netdev.Gateway }}
{{- end }}
{{- $dns := "" }}
{{- range $tk, $tv := $netdev.Tags }}
{{- if eq (substr 0 3 $tk) "DNS" }}
{{- if regexMatch "^DNS[0-9]*$" $tk }}
{{- $dns = print $dns $tv ";" }}
{{- else if eq (substr 0 5 $tk) "route" }}
{{$tk}}={{$tv}}
@@ -59,6 +59,9 @@ gateway={{ $netdev.Gateway }}
{{- if $dns }}
dns={{$dns}}
{{- end }}
{{- if $netdev.Tags.DNSSEARCH }}
dns-search={{ join ";" (without (regexSplit "[ ;]+" $netdev.Tags.DNSSEARCH -1) "") }};
{{- end }}
{{- end }}
{{- if eq $netdev.Type "vlan" }}