{% for ifdata in interfaces if ifdata.vlan is defined %}
!
interface {{ ifdata.ifname }}
{%   if ifdata.vlan.access_id is defined %}
 switchport
 switchport access vlan {{ ifdata.vlan.access_id }}
{%   endif %}
{%   if ifdata.vlan.trunk_id is defined %}
 switchport
 switchport mode trunk
 switchport trunk allowed vlan {{ ifdata.vlan.trunk_id|join(",") }}
{%   endif %}
{% endfor %}
