blob: b533fe495b30066ea5f647311bd67c0b1a66d2e6 [file] [log] [blame]
Vamsi Savaram52abf122019-07-22 13:04:02 +00001{%- set macaddress = item.key -%}
2{%- set device = item.value -%}
Vamsi Savaram20dde3b2019-08-07 09:09:42 +00003{%- for selected_net_name, selected_net in idf.net_config.items() if node.interfaces[selected_net.interface].mac_address == macaddress -%}
Vamsi Savaram52abf122019-07-22 13:04:02 +00004{%- set selected_inf = node.interfaces[selected_net.interface] -%}
5TYPE=Ethernet
6DEVICE={{ device }}
7ONBOOT=yes
8HWADDR={{ macaddress }}
9{% if selected_inf.address == "dhcp" %}
10BOOTPROTO=dhcp
11{% elif selected_inf.address != "manual" %}
12BOOTPROTO=none
13IPADDR={{ selected_inf.address | ipaddr('address') }}
14NETMASK={{ (selected_net.network + "/" + (selected_net.mask | string)) | ipaddr('netmask') }}
15{% endif %}
16{% if selected_net.gateway is defined %}
17GATEWAY={{ selected_net.gateway | ipaddr('address') }}
18{% endif %}
19{% if selected_net.dns is defined %}
20{% for dns in selected_net.dns %}
21DNS{{ loop.index0 }}={{ dns }}
22{% endfor %}
23{% endif %}
24
25{%- endfor -%}