feat: add metric support and fix net-persist issues with multiple NICs
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
# This file describes the network interfaces available on your system
|
||||
# and how to activate them. For more information, see interfaces(5).
|
||||
|
||||
# The primary network interface
|
||||
allow-hotplug {{ interface.name }}
|
||||
iface {{ interface.name }} inet dhcp
|
||||
|
||||
# This is an autoconfigured IPv6 interface
|
||||
iface {{ interface.name }} inet6 auto
|
||||
@@ -1,9 +1,24 @@
|
||||
# {{ ansible_managed }}
|
||||
# systemd.network(5)
|
||||
|
||||
[Match]
|
||||
Name={{ interface.name }}
|
||||
|
||||
[Network]
|
||||
[Address]
|
||||
Address={{ interface.ipv4.address }}
|
||||
Gateway={{ interface.ipv4.gateway }}
|
||||
{% if interface.ipv4.metric is defined %}
|
||||
RouteMetric={{ interface.ipv4.metric }}
|
||||
{% endif %}
|
||||
|
||||
[Network]
|
||||
{% for dns in interface.ipv4.nameservers %}
|
||||
DNS={{ dns }}
|
||||
{% endfor %}
|
||||
|
||||
{% if interface.ipv4.gateway is defined %}
|
||||
[Route]
|
||||
Gateway={{ interface.ipv4.gateway }}
|
||||
{% if interface.ipv4.metric is defined %}
|
||||
Metric={{ interface.ipv4.metric }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user