Skip to content

Commit

Permalink
Fix(eos_designs): Fix context vars for custom interface description t…
Browse files Browse the repository at this point in the history
…emplates (#4437)

Co-authored-by: Carl Buchmann <[email protected]>
  • Loading branch information
ClausHolbechArista and carlbuchmann authored Sep 6, 2024
1 parent 25da256 commit 1cec539
Show file tree
Hide file tree
Showing 24 changed files with 578 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ outside of that, so any inline Jinja2 could not use these values.
| switch.type | fabric-topology.j2 |
| switch.mpls_overlay_role |interface_descriptions/loopback_interfaces/overlay-loopback.j2 |
| switch.mpls_lsr |interface_descriptions/loopback_interfaces/overlay-loopback.j2 |
| switch.mlag_peer | interface_descriptions/mlag/ethernet-interfaces.j2 |
| switch.mlag_interfaces | interface_descriptions/mlag/port-channel-interfaces.j2 |
| switch.mlag_peer | interface_descriptions/mlag/port-channel-interfaces.j2 |
| switch.mlag_port_channel_id | interface_descriptions/mlag/port-channel-interfaces.j2 |
| switch.uplink_ipv4_pool | ip_addressing/avd-v2-spine-p2p-uplinks-ip.j2 |
| switch.id | ip_addressing/avd-v2-spine-p2p-uplinks-ip.j2 |
| switch.max_parallel_uplinks | ip_addressing/avd-v2-spine-p2p-uplinks-ip.j2 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ description_prefix }}_{{ peer }}_{{ peer_interface }}
{{ description_prefix }}_{{ peer }}_{{ peer_interface }}_{{ adapter_description }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ description_prefix }}_{{ peer }}_{{ adapter_port_channel_description }}
{{ description_prefix }}_{{ peer }}_{{ adapter_description }}_{{ adapter_port_channel_description }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ description_prefix }}_MLAG_PEER_{{ switch.mlag_peer }}_{{ mlag_interface }}
{{ description_prefix }}_MLAG_PEER_{{ mlag_peer }}_{{ mlag_interface }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ description_prefix }}_MLAG_PEER_{{ switch.mlag_peer }}_Po{{ switch.mlag_interfaces[0] | regex_findall("\d") | join }}
{{ description_prefix }}_MLAG_PEER_{{ mlag_peer }}_Eth{{ mlag_interfaces[0] | regex_findall("\d") | join }}_Eth{{ mlag_interfaces[1] | regex_findall("\d") | join }}_Po{{ mlag_port_channel_id }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ description_prefix }}_{{ link.channel_description | arista.avd.default(link.peer) | upper }}_Po{{ link.peer_channel_group_id }}
{{ description_prefix }}_{{ link.peer | upper }}_To_Po{{ link.peer_channel_group_id }}_{{ link.channel_description }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
!RANCID-CONTENT-TYPE: arista
!
vlan internal order ascending range 1006 1199
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname CUSTOM-TEMPLATES-L2LEAF1A
!
no spanning-tree vlan-id 4094
!
no enable password
no aaa root
!
vlan 4094
name MLAG_PEER
trunk group MLAG
!
vrf instance MGMT
!
interface Port-Channel1
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L3LEAF1A_To_Po5_CUSTOM_TEMPLATES_L3LEAF1
no shutdown
switchport
switchport trunk allowed vlan none
switchport mode trunk
mlag 1
!
interface Port-Channel3
description MLAG_PEER_CUSTOM-TEMPLATES-L2LEAF1B_Po3
no shutdown
switchport
switchport mode trunk
switchport trunk group MLAG
!
interface Ethernet1
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L3LEAF1A_Ethernet5
no shutdown
channel-group 1 mode active
!
interface Ethernet2
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L3LEAF1B_Ethernet5
no shutdown
channel-group 1 mode active
!
interface Ethernet3
description MLAG_PEER_CUSTOM-TEMPLATES-L2LEAF1B_Ethernet3
no shutdown
channel-group 3 mode active
!
interface Ethernet4
description MLAG_PEER_CUSTOM-TEMPLATES-L2LEAF1B_Ethernet4
no shutdown
channel-group 3 mode active
!
interface Management1
description oob_management
no shutdown
vrf MGMT
ip address 192.168.200.103/24
!
interface Vlan4094
description MLAG_PEER
no shutdown
mtu 9214
no autostate
ip address 10.255.252.0/31
no ip routing vrf MGMT
!
mlag configuration
domain-id CUSTOM_TEMPLATES_L2LEAF1
local-interface Vlan4094
peer-address 10.255.252.1
peer-link Port-Channel3
reload-delay mlag 300
reload-delay non-mlag 330
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.1
!
management api http-commands
protocol https
no shutdown
!
vrf MGMT
no shutdown
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
!RANCID-CONTENT-TYPE: arista
!
vlan internal order ascending range 1006 1199
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname CUSTOM-TEMPLATES-L2LEAF1B
!
no spanning-tree vlan-id 4094
!
no enable password
no aaa root
!
vlan 4094
name MLAG_PEER
trunk group MLAG
!
vrf instance MGMT
!
interface Port-Channel1
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L3LEAF1A_To_Po5_CUSTOM_TEMPLATES_L3LEAF1
no shutdown
switchport
switchport trunk allowed vlan none
switchport mode trunk
mlag 1
!
interface Port-Channel3
description MLAG_PEER_CUSTOM-TEMPLATES-L2LEAF1A_Po3
no shutdown
switchport
switchport mode trunk
switchport trunk group MLAG
!
interface Ethernet1
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L3LEAF1A_Ethernet6
no shutdown
channel-group 1 mode active
!
interface Ethernet2
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L3LEAF1B_Ethernet6
no shutdown
channel-group 1 mode active
!
interface Ethernet3
description MLAG_PEER_CUSTOM-TEMPLATES-L2LEAF1A_Ethernet3
no shutdown
channel-group 3 mode active
!
interface Ethernet4
description MLAG_PEER_CUSTOM-TEMPLATES-L2LEAF1A_Ethernet4
no shutdown
channel-group 3 mode active
!
interface Management1
description oob_management
no shutdown
vrf MGMT
ip address 192.168.200.103/24
!
interface Vlan4094
description MLAG_PEER
no shutdown
mtu 9214
no autostate
ip address 10.255.252.1/31
no ip routing vrf MGMT
!
mlag configuration
domain-id CUSTOM_TEMPLATES_L2LEAF1
local-interface Vlan4094
peer-address 10.255.252.0
peer-link Port-Channel3
reload-delay mlag 300
reload-delay non-mlag 330
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.1
!
management api http-commands
protocol https
no shutdown
!
vrf MGMT
no shutdown
!
end
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ vrf instance MGMT
vrf instance TEST_VRF
!
interface Port-Channel3
description TEST_CUSTOM_PREFIX_MLAG_PEER_CUSTOM-TEMPLATES-L3LEAF1B_Po3
description TEST_CUSTOM_PREFIX_MLAG_PEER_CUSTOM-TEMPLATES-L3LEAF1B_Eth3_Eth4_Po3
no shutdown
switchport
switchport mode trunk
switchport trunk group LEAF_PEER_L3
switchport trunk group MLAG
!
interface Port-Channel5
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L2LEAF1A_To_Po1_CUSTOM_TEMPLATES_L2LEAF1
no shutdown
switchport
switchport trunk allowed vlan none
switchport mode trunk
mlag 5
!
interface Ethernet1
description TEST_CUSTOM_PREFIX_P2P_LINK_TO_CUSTOM-TEMPLATES-SPINE1_Ethernet1
no shutdown
Expand All @@ -57,8 +65,18 @@ interface Ethernet4
no shutdown
channel-group 3 mode active
!
interface Ethernet5
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L2LEAF1A_Ethernet1
no shutdown
channel-group 5 mode active
!
interface Ethernet6
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L2LEAF1B_Ethernet1
no shutdown
channel-group 5 mode active
!
interface Ethernet11
description TEST_CUSTOM_PREFIX_SERVER-1_Nic1
description TEST_CUSTOM_PREFIX_SERVER-1_Nic1_management
no shutdown
switchport mode trunk
switchport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ vrf instance MGMT
vrf instance TEST_VRF
!
interface Port-Channel3
description TEST_CUSTOM_PREFIX_MLAG_PEER_CUSTOM-TEMPLATES-L3LEAF1A_Po3
description TEST_CUSTOM_PREFIX_MLAG_PEER_CUSTOM-TEMPLATES-L3LEAF1A_Eth3_Eth4_Po3
no shutdown
switchport
switchport mode trunk
switchport trunk group LEAF_PEER_L3
switchport trunk group MLAG
!
interface Port-Channel5
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L2LEAF1A_To_Po1_CUSTOM_TEMPLATES_L2LEAF1
no shutdown
switchport
switchport trunk allowed vlan none
switchport mode trunk
mlag 5
!
interface Port-Channel12
description TEST_CUSTOM_PREFIX_SERVER-2_portchannel
description TEST_CUSTOM_PREFIX_SERVER-2_data_portchannel
no shutdown
switchport
switchport mode trunk
Expand All @@ -63,13 +71,23 @@ interface Ethernet4
no shutdown
channel-group 3 mode active
!
interface Ethernet5
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L2LEAF1A_Ethernet2
no shutdown
channel-group 5 mode active
!
interface Ethernet6
description TEST_CUSTOM_PREFIX_CUSTOM-TEMPLATES-L2LEAF1B_Ethernet2
no shutdown
channel-group 5 mode active
!
interface Ethernet12
description TEST_CUSTOM_PREFIX_SERVER-2_Nic1
description TEST_CUSTOM_PREFIX_SERVER-2_Nic1_data
no shutdown
channel-group 12 mode active
!
interface Ethernet13
description TEST_CUSTOM_PREFIX_SERVER-2_Nic2
description TEST_CUSTOM_PREFIX_SERVER-2_Nic2_data
no shutdown
channel-group 12 mode active
!
Expand Down
Loading

0 comments on commit 1cec539

Please sign in to comment.