feat(bootstrap): accept extra_addresses on network interfaces
This commit is contained in:
@@ -19,6 +19,9 @@ interface-name=en*;eth*;
|
||||
{% set search_list = configuration_dns_search %}
|
||||
{% if iface.ip | default('') | string | length %}
|
||||
address1={{ iface.ip }}/{{ iface.prefix }}{{ (',' ~ iface.gateway) if (iface.gateway | default('') | string | length) else '' }}
|
||||
{% for address in iface.extra_addresses | default([]) %}
|
||||
address{{ loop.index + 1 }}={{ address }}
|
||||
{% endfor %}
|
||||
method=manual
|
||||
{% else %}
|
||||
method=auto
|
||||
|
||||
@@ -16,6 +16,11 @@ iface {{ ifname }} inet static
|
||||
{% if loop.index0 == 0 and configuration_dns_search %}
|
||||
dns-search {{ configuration_dns_search | join(' ') }}
|
||||
{% endif %}
|
||||
{# One stanza per extra address: classic ifupdown takes one address per stanza, ifupdown2 merges them. #}
|
||||
{% for address in iface.extra_addresses | default([]) %}
|
||||
iface {{ ifname }} inet static
|
||||
address {{ address }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
iface {{ ifname }} inet dhcp
|
||||
{% endif %}
|
||||
|
||||
@@ -9,6 +9,9 @@ network:
|
||||
{% if iface.ip | default('') | string | length %}
|
||||
addresses:
|
||||
- {{ iface.ip }}/{{ iface.prefix }}
|
||||
{% for address in iface.extra_addresses | default([]) %}
|
||||
- {{ address }}
|
||||
{% endfor %}
|
||||
{% if iface.gateway | default('') | string | length %}
|
||||
routes:
|
||||
- to: default
|
||||
|
||||
@@ -11,6 +11,9 @@ Type=ether
|
||||
[Network]
|
||||
{% if iface.ip | default('') | string | length %}
|
||||
Address={{ iface.ip }}/{{ iface.prefix }}
|
||||
{% for address in iface.extra_addresses | default([]) %}
|
||||
Address={{ address }}
|
||||
{% endfor %}
|
||||
{% if iface.gateway | default('') | string | length %}
|
||||
Gateway={{ iface.gateway }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user