vm_interfaces.tmpl 478 B

12345678910
  1. {%- for vm_fqdn, vm_cfg in vms.items ()|sort %}
  2. {%- set vm_name = vm_fqdn.split ('.')[0].split ('-')[0] %}
  3. {%- for vm_iface, iface_cfg in vm_cfg['ifaces'].items ()|sort %}
  4. {%- if iface_cfg.get ('vlan-mode') == 'tagged' and iface_cfg.get ('tagged_vlans') %}
  5. {%- set host_iface = "%s_%s" % (vm_name, vm_iface.replace ('vlan', 'v')) %}
  6. iface {{ host_iface }}
  7. bridge-vids {{ iface_cfg.get ('tagged_vlans')|join (' ') }}
  8. {%- endif %}
  9. {%- endfor %}
  10. {%- endfor %}