1 {{- define "machine.networkData" -}}
5 {{- $local := dict "first" true -}}
6 {{- range $name, $network := .networks }}
7 {{- if not $local.first }}
12 {{- $_ := set $local "first" false }}
13 "id": "{{ $name }}_nic",
14 "ethernet_mac_address": "{{ $network.macAddress }}",
20 {{- $local := dict "first" true -}}
21 {{- range $name, $network := .networks }}
22 {{- if not $local.first }}
27 {{- $_ := set $local "first" false }}
29 "link": "{{ $name }}_nic",
30 "type": "{{ $network.type }}"{{- if $network.ipAddress }},
31 "ip_address": "{{ $network.ipAddress }}"{{- end }}{{- if $network.gateway }},
32 "gateway": "{{ $network.gateway }}"{{- end }}{{- if $network.nameservers }},
33 "dns_nameservers": {{ $network.nameservers }}{{- end }}