feat(configuration): multi-backend networking, bind by match not MAC
This commit is contained in:
23
roles/configuration/templates/network_eni.j2
Normal file
23
roles/configuration/templates/network_eni.j2
Normal file
@@ -0,0 +1,23 @@
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
{% for iface in system_cfg.network.interfaces %}
|
||||
{% set ifname = iface.name if (iface.name | default('') | string | length) else (configuration_eni_detected[loop.index0] | default('eth' ~ loop.index0)) %}
|
||||
auto {{ ifname }}
|
||||
{% if iface.ip | default('') | string | length %}
|
||||
iface {{ ifname }} inet static
|
||||
address {{ iface.ip }}/{{ iface.prefix }}
|
||||
{% if iface.gateway | default('') | string | length %}
|
||||
gateway {{ iface.gateway }}
|
||||
{% endif %}
|
||||
{% if loop.index0 == 0 and configuration_dns_list %}
|
||||
dns-nameservers {{ configuration_dns_list | join(' ') }}
|
||||
{% endif %}
|
||||
{% if loop.index0 == 0 and configuration_dns_search %}
|
||||
dns-search {{ configuration_dns_search | join(' ') }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
iface {{ ifname }} inet dhcp
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user