mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
fix vlan template and data
This commit is contained in:
parent
d6c58b7d21
commit
fc49a2479e
2 changed files with 5 additions and 5 deletions
|
@ -145,9 +145,13 @@ func GenerateNetworkdConfiguration(conf definitions.Config) ([]NetworkdConfigFil
|
|||
slog.Info("Vlans on interface", "interface", name, "count", len(vlans))
|
||||
|
||||
if len(vlans) != 0 {
|
||||
parentName := name
|
||||
if inter.Type == definitions.Hardware {
|
||||
parentName = *inter.HardwareDevice
|
||||
}
|
||||
buf := new(bytes.Buffer)
|
||||
err := templates.ExecuteTemplate(buf, "vlan-assignments.network.tmpl", VlanAssignments{
|
||||
Name: name,
|
||||
Name: parentName,
|
||||
Vlans: vlans,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
[Match]
|
||||
{{- if eq .Type 0 }}
|
||||
Name={{ .HardwareDevice }}
|
||||
{{- else }}
|
||||
Name={{ .Name }}
|
||||
{{- end }}
|
||||
|
||||
[Network]
|
||||
{{- range .Vlans }}
|
||||
|
|
Loading…
Add table
Reference in a new issue