Guest User

Untitled

a guest
Nov 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. {# ############################################## fail if add, no longer supported #}
  2. {% if 'add' in interface['value']['switchport']['trunk']['allowed_vlans'] %}
  3. {{ you_cant_use_the_add_statement_anymore }}
  4. {% endif %}
  5. {# ############################################## remediate the trunk list #}
  6. {% set trunk_vlan_changes = configuration_prechange['matches']['sections'][0]['section_content']|trunk_vlan_remediate(interface['value']['switchport']['trunk']['allowed_vlans']['vlans'],20) %}
  7. {% if 'vlans' in trunk_vlan_changes and trunk_vlan_changes['vlans'] %}
  8. {% set _ = desired.append("switchport trunk allowed vlan %s" % (trunk_vlan_changes['vlans'])) %}
  9. {% endif %}{# vlans #}
  10. {% for entry in trunk_vlan_changes['vlans_add'] %}
  11. {% set _ = desired.append("switchport trunk allowed vlan add %s" % (entry)) %}
  12. {% endfor %}{# vlans_add #}
  13. {% for entry in trunk_vlan_changes['vlans_remove'] %}
  14. {% set _ = desired.append("switchport trunk allowed vlan remove %s" % (entry)) %}
  15. {% endfor %}{# vlans_remove #}
  16. {% endif %}{# allowed-vlans #}
  17. {% endif %}{# switchport trunk #}
Add Comment
Please, Sign In to add comment