name: {{ name }}

topology:
  nodes:
{% for n in nodes %}
    {{ n.name }}:
      kind: {{ n.kind | default(n.device) }}
      image: {{ n.box }}
{%   if 'runtime' in n %}
      runtime: {{ n.runtime }}
{%   endif %}
{% endfor %}

  links:
{% for l in links %}
  - endpoints:
{%   for n in nodes %}
{%     for nl in n.links if nl.linkindex == l.linkindex %}
    - "{{ n.name }}:{{ nl.provider_ifname if 'provider_ifname' in nl else nl.ifname }}"
{%      endfor %}
{%    endfor %}
{% endfor %}
