Chapter 8 Data Models and Dynamic Templates

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 156
priority-queue out 
{%                  endif %}     
{%              endif %} 
 storm-control broadcast level 30.00 
 storm-control multicast level 30.00 
 no lldp transmit 
 no lldp receive 
 spanning-tree portfast 
 spanning-tree bpduguard enable 
 service-policy input PM-QoS-IN 
{%              endif %} 
{%          endif %} 
{%      endfor %} 
{%  endif %} 
 
Custom Interfaces 
 
Not all interfaces will fit a predefined type or port profile since every single combination of interface 
sub-command does not scale. Instead, this catch-all “custom” port profile has many small “if” statements 
checking for flags defined under an interface in a data model. These custom cases do not define a type 
field but rather define, option-by-option, what is needed to enable and disable each field.
{%  if host_interfaces is defined %} 
{%      for host_interface in host_interfaces %} 
{%          if host_interfaces[host_interface].type is not defined %} 
interface {{ host_interface }} 
{%              if host_interfaces[host_interface].switchport is defined %} 
{%                  if host_interfaces[host_interface].switchport == true %} 
 switchport nonegotiate 
{%                      if platform_defaults.type == 6000 %} 
 switchport  
{%                      endif %} 
{%                      if host_interfaces[host_interface].switchport_mode == "access" 
%} 
 switchport mode access 
 switchport access vlan {{ host_interfaces[host_interface].vlans }} 
{%                         if platform_defaults.type == 6000 %} 
 spanning-tree portfast edge 
{%                          else %} 
 spanning-tree portfast 
{%                          endif %} 
 spanning-tree bpduguard enable 
{%                      else %} 
 switchport mode trunk  
switchport trunk native vlan {{ global_campus_defaults.native_vlan }} 
 switchport trunk allowed vlan {{ host_interfaces[host_interface].vlans }} 
{%                      endif %} 
{%                  else %} 
 no switchport  
{%                  endif %} 
{%              endif %} 
{%              if host_defaults.poe is defined %} 
{%              else %} 
{%                  if power_inline is defined %} 
{%                      if power_inline == false %}