<!-- INTERNAL TABLE FOR L3_INTERFACES -->
<div id="accordion">
<div>
<h3>L3 Interfaces - IP Addresses</h3>
<div class="net_content">
{% if hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l3_interfaces']|length > 0 %}
<table id="subtable">
    <thead>
        <tr>
            <th>Interface Name</th>
            <th>IPv4</th>
            <th>IPv6</th>
        </tr>
    </thead>
    <tbody>
{% for interface in hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] %}
        <tr>
            <td>{{interface['name']}}</td>
<!-- INTERNAL IPv4 LOOP FOR L3_INTERFACES -->
            <td>
{% if interface.ipv4 is defined %}
{% for address in interface.ipv4 %}
{{ address['address']|default("Not Configured") }}
{% if address['secondary'] is defined %}
secondary
{% endif %}
{% if loop.length > 1 and not loop.last %}<br>{% endif %}
{% endfor %}
{% endif %}
            </td>
<!-- END IPv4 INTERNAL LOOP FOR L3_INTERFACES -->
<!-- INTERNAL IPv6 LOOP FOR L3_INTERFACES -->
            <td>
{% if interface.ipv6 is defined %}
{% for v6address in interface.ipv6 %}
{{v6address['address']|default("Not Configured") }}
{% if loop.length > 1 and not loop.last %}<br>{% endif %}
{% endfor %}
{% endif %}
            </td>
<!-- END INTERNAL LOOP FOR L3_INTERFACES -->
        </tr>
{% endfor %}
    </tbody>
</table>
{% elif hostvars[network_switch]['ansible_network_resources']['l3_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l3_interfaces']|length == 0 %}
L3 information is not configured on this device
{% else %}
No L3 information available
{% endif %}
</div>
</div>
</div>
<!-- END INTERNAL TABLE FOR L3_INTERFACES -->
