feat(configuration): multi-backend networking, bind by match not MAC
This commit is contained in:
27
roles/configuration/templates/network_networkd.j2
Normal file
27
roles/configuration/templates/network_networkd.j2
Normal file
@@ -0,0 +1,27 @@
|
||||
[Match]
|
||||
{% set iface = configuration_iface %}
|
||||
{% if iface.name | default('') | string | length %}
|
||||
Name={{ iface.name }}
|
||||
{% else %}
|
||||
{# First available ethernet by name glob + device type, never a MAC (#12). #}
|
||||
Name=en* eth*
|
||||
Type=ether
|
||||
{% endif %}
|
||||
|
||||
[Network]
|
||||
{% if iface.ip | default('') | string | length %}
|
||||
Address={{ iface.ip }}/{{ iface.prefix }}
|
||||
{% if iface.gateway | default('') | string | length %}
|
||||
Gateway={{ iface.gateway }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
DHCP=yes
|
||||
{% endif %}
|
||||
{% if idx | int == 0 and configuration_dns_list %}
|
||||
{% for dns in configuration_dns_list %}
|
||||
DNS={{ dns }}
|
||||
{% endfor %}
|
||||
{% if configuration_dns_search %}
|
||||
Domains={{ configuration_dns_search | join(' ') }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user