33 lines
742 B
Smarty
33 lines
742 B
Smarty
version: 2
|
|
ethernets:
|
|
%{ for i, net in node.networks ~}
|
|
eth${i}:
|
|
match:
|
|
macaddress: "${net.mac_address}"
|
|
dhcp4: false
|
|
%{ if i == 0 && net.vlan_id == 0 ~}
|
|
addresses:
|
|
- ${net.ip}/${split("/", net.cidr)[1]}
|
|
gateway4: ${net.gateway}
|
|
nameservers:
|
|
addresses:
|
|
%{ for dns in dns_servers ~}
|
|
- ${dns}
|
|
%{ endfor ~}
|
|
%{ endif ~}
|
|
%{ endfor ~}
|
|
%{ if node.networks[0].vlan_id > 0 ~}
|
|
vlans:
|
|
eth0.${node.networks[0].vlan_id}:
|
|
id: ${node.networks[0].vlan_id}
|
|
link: eth0
|
|
addresses:
|
|
- ${node.networks[0].ip}/${split("/", node.networks[0].cidr)[1]}
|
|
gateway4: ${node.networks[0].gateway}
|
|
nameservers:
|
|
addresses:
|
|
%{ for dns in dns_servers ~}
|
|
- ${dns}
|
|
%{ endfor ~}
|
|
%{ endif ~}
|