feat(network): make interfaces[] canonical, normalize flat fields as AWX compat

Flat network fields (bridge, ip, prefix, gateway, vlan) are now converted
into a single-entry interfaces[] list during normalization. All virtualization
tasks (proxmox, vmware, libvirt, xen) and configuration (NM, Alpine, Void)
now consume system_cfg.network.interfaces exclusively for multi-NIC support.

Also fixes: user.key -> user.keys in system_cfg output, strict list-only DNS
in example inventories, removes legacy single-MAC virtualization_mac_address
default.
This commit is contained in:
2026-02-12 22:17:02 +01:00
parent d7260a8078
commit 8071a7c56c
17 changed files with 222 additions and 159 deletions

View File

@@ -1,24 +1,26 @@
[connection]
id=LAN
id=LAN-{{ idx }}
uuid={{ configuration_net_uuid }}
type=ethernet
interface-name={{ configuration_iface_name }}
[ipv4]
{% set iface = configuration_iface %}
{% set dns_list = system_cfg.network.dns.servers | default([]) %}
{% set search_list = system_cfg.network.dns.search | default([]) %}
{% if system_cfg.network.ip is defined and system_cfg.network.ip | string | length %}
address1={{ system_cfg.network.ip }}/{{ system_cfg.network.prefix }}{{ (',' ~ system_cfg.network.gateway) if (system_cfg.network.gateway is defined and system_cfg.network.gateway | string | length) else '' }}
{% if iface.ip | default('') | string | length %}
address1={{ iface.ip }}/{{ iface.prefix }}{{ (',' ~ iface.gateway) if (iface.gateway | default('') | string | length) else '' }}
method=manual
{% else %}
method=auto
{% endif %}
{% if dns_list %}
{% if idx | int == 0 and dns_list %}
dns={{ dns_list | join(';') }}
{% endif %}
{% if dns_list %}
{% if idx | int == 0 and dns_list %}
ignore-auto-dns=true
{% endif %}
{% if search_list %}
{% if idx | int == 0 and search_list %}
dns-search={{ search_list | join(';') }}
{% endif %}