!
feature bgp
!
{% for vname,vdata in vrfs.items() %}
vrf context {{ vname }}
  rd {{ vdata.rd }}
{%   for af in ['ipv4','ipv6'] if af in vdata.af|default({}) %}
  address-family {{ af }} unicast
{%    for rt in vdata.import %}
    route-target import {{ rt }}
{%    endfor %}
{%    for rt in vdata.export %}
    route-target export {{ rt }}
{%    endfor %}
  exit
{%   endfor %}
{% endfor %}
