Merge pull request #1072 from JasonYangShadow/issue/922
add DNS fields to multiple managed templates
This commit is contained in:
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Add nightly release support. #969
|
||||
- Add container rename command. #583
|
||||
- Add container build flags and warn message after container sync. #509
|
||||
- Add DNS fields to network configuration overlays. #922
|
||||
|
||||
### Fixed
|
||||
- Make Variables.mk consistent with spec file w.r.t. WWPROVISIONDIR, e.g.
|
||||
|
||||
@@ -65,6 +65,16 @@ address={{ $netdev.IpCIDR }}
|
||||
gateway={{ $netdev.Gateway }}
|
||||
{{ end -}}
|
||||
method=manual
|
||||
{{- $dns := "" }}
|
||||
{{range $tk, $tv := $netdev.Tags -}}
|
||||
{{ $prefix := slice $tk 0 3 -}}
|
||||
{{ if eq $prefix "DNS" -}}
|
||||
{{ $dns = print $dns $tv ";" -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ if ne $dns "" -}}
|
||||
dns={{$dns}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{/* always autoconfigure ipv6 */}}
|
||||
|
||||
15
overlays/wwinit/etc/resolv.conf.ww
Normal file
15
overlays/wwinit/etc/resolv.conf.ww
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $host := .BuildHost }}
|
||||
{{- $time := .BuildTime }}
|
||||
{{- $source := .BuildSource }}
|
||||
# This file is autogenerated by warewulf
|
||||
# Host: {{ $host }}
|
||||
# Time: {{ $time }}
|
||||
# Source: {{ $source }}
|
||||
{{range $devname, $netdev := .NetDevs -}}
|
||||
{{range $tk, $tv := $netdev.Tags -}}
|
||||
{{ $prefix := slice $tk 0 3 -}}
|
||||
{{ if eq $prefix "DNS" -}}
|
||||
nameserver {{ $tv }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
@@ -37,4 +37,10 @@ IPV6_FAILURE_FATAL=no
|
||||
{{ if $netdev.Ipaddr6 -}}
|
||||
IPV6ADDR="{{ $netdev.Ipaddr6 }}"
|
||||
{{ end -}}
|
||||
{{range $tk, $tv := $netdev.Tags -}}
|
||||
{{ $prefix := slice $tk 0 3 -}}
|
||||
{{ if eq $prefix "DNS" -}}
|
||||
{{ $tk }}={{ $tv }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
Reference in New Issue
Block a user