{#
 Enables the EVPN address family for eBGP or iBGP peers (ipv4 for now)

 Assumes bgp.as == AS used for EVPN
#}

updates:
- path: network-instance[name=default]/protocols/bgp
  val:
   group:
   - group-name: {{ 'ibgp-ipv4' if evpn.use_ibgp else 'ebgp' }} # Could create a dedicated group for EVPN only?
     evpn:
      admin-state: enable
     ipv4-unicast:
      admin-state: {{ 'enable' if not evpn.use_ibgp and 'ipv4' in bgp else 'disable' }}
     ipv6-unicast:
      admin-state: {{ 'enable' if not evpn.use_ibgp and 'ipv6' in bgp else 'disable' }}
   evpn:
    rapid-update: True
