updates:
- path: network-instance[name=default]/protocols/isis
  val:
   instance:
   - name: Gandalf
     admin-state: enable
     net: [ "{{ isis.net | default( "%s.0000.0000.%04d.00" % (isis.area,id) ) }}" ]
     level-capability: "{{ 'L2' if isis.type=='level-2' else 'L1' if isis.type=='level-1' else 'L1L2' }}"
{%   if isis.af.ipv6 is defined %}
     ipv6-unicast:
      admin-state: enable
      multi-topology: {{ 'sr' not in module|default([]) }}
      _annotate_multi-topology: "Not supported in combination with SR"
{%   endif %}
     interface:
     - interface-name: system0.0
       passive: True
       ipv4-unicast:
        admin-state: {{ 'enable' if loopback.ipv4|default('')|ipv4 and 'ipv4' in isis.af else 'disable' }}
       ipv6-unicast:
        admin-state: {{ 'enable' if loopback.ipv6|default('')|ipv6 and 'ipv6' in isis.af else 'disable' }}

{%   for l in interfaces|default([]) %}
{%    if "isis" not in l %}
     # IS-IS not configured on external interface {{ l.ifname }}
     - interface-name: {{ l.ifname }}.0
       admin-state: disable
       _annotate_admin-state: "Disabled on external interface"
{%    else %}
     - interface-name: {{ l.ifname }}.0
       circuit-type: {{ l.isis.network_type|default("broadcast") }}
       passive: {{ l.isis.passive }}
{%     if 'ipv4' in l and 'ipv4' in isis.af %}
       ipv4-unicast:
        admin-state: enable
        enable-bfd: {{ l.isis.bfd.ipv4|default(False) }}
{%     endif %}
{%     if 'ipv6' in l and 'ipv6' in isis.af  %}
       ipv6-unicast:
        admin-state: enable
        enable-bfd: {{ l.isis.bfd.ipv6|default(False) }}
{%     endif %}
{%     if l.isis.metric is defined or l.isis.cost is defined %}
       level:
       - level-number: 1
         metric-style: wide
         metric: {{ l.isis.metric|default(l.isis.cost) }}
       - level-number: 2
         metric-style: wide
         metric: {{ l.isis.metric|default(l.isis.cost) }}
{%     endif %}
{%    endif %}
{%   endfor %}
