New implementation of network interfaces

Combine interfaces and network_ether_interfaces into one common
variable network_interfaces. Provisioning uses format:

network_interfaces:
  - device: device name eg. vio0 or eth0
    vlan: vlan id for this interface
    mac: mac address for interface (optional)

Additionally network role will use more settings to configure
interface.
This commit is contained in:
Timo Makinen 2020-08-27 17:42:07 +00:00
parent 78c9a2eaf1
commit c80eca3d85
11 changed files with 46 additions and 19 deletions

View file

@ -24,11 +24,13 @@
{% endif %}
virt_install_network: >-
{% for item in interfaces %}
{% if item[1] is defined %}
--network bridge=br{{ item[0] }},mac={{ item[1] }},model=virtio
{% else %}
--network bridge=br{{ item[0] }},model=virtio
{% for item in network_interfaces %}
{% if item.vlan is defined %}
{% if item.mac is defined %}
--network bridge=br{{ item.vlan }},mac={{ item.mac }},model=virtio
{% else %}
--network bridge=br{{ item.vlan }},model=virtio
{% endif %}
{% endif %}
{% endfor %}