{% from "templates/bgp/sros.gnmi.macro.j2" import bgp_config with context %}

updates:
{% for vname,vdata in vrfs.items() %}

- path: configure/service/vprn[service-name={{ vname }}]
  val:
   service-id: {{ vdata.vrfidx }}
   customer: "1"
   autonomous-system: {{ bgp.as }}
   router-id: {{ vdata.bgp.router_id|default(bgp.router_id) }}
   ecmp: 64
   admin-state: enable

{% if vdata.bgp is defined %}
{{ bgp_config(vdata.bgp,vname) }}
{% endif %}

{% endfor %}