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

@@ -46,11 +46,13 @@
<target dev="sdc" bus="sata"/>
</disk>
{% endif %}
{% for iface in system_cfg.network.interfaces %}
<interface type='network'>
<mac address="{{ virtualization_mac_address }}"/>
<source network='{{ system_cfg.network.bridge if (system_cfg.network.bridge | default('' ) | string | length) > 0 else "default" }}'/>
<mac address="{{ '52:54:00' | community.general.random_mac(seed=hostname if loop.index0 == 0 else hostname ~ '-nic' ~ loop.index0) }}"/>
<source network='{{ iface.bridge | default("default") }}'/>
<model type='virtio'/>
</interface>
{% endfor %}
{% if virtualization_tpm2_enabled %}
<tpm model='tpm-crb'>
<backend type='emulator' version='2.0'/>