Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add evpn ethernet-segment support for LAG interface #263

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions models/enterprise_sonic/lag_interfaces/deleted_example_01.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# Using deleted

#
# Before state:
# -------------
# interface PortChannel10
# !
#
# interface Eth1/10
# channel-group 10
# mtu 9100
# speed 100000
# no shutdown

- name: Deletes LAG attributes of given interface (Note: This will not delete the port-channel itself).
# !
# interface PortChannel10
# no shutdown
# !
# evpn ethernet-segment auto-lacp
# df-preference 2222
#
- name: Deletes all LAGs and LAG attributes of all interfaces.
sonic_lag_interfaces:
config:
- name: PortChannel10
members:
interfaces:
- member: Eth1/10
ethernet_segment:
esi_type: auto_lacp
state: deleted

#
# After state:
# ------------
# interface PortChannel10
# !
# -------------
#
# interface Eth1/10
# mtu 9100
# speed 100000
# no shutdown
# !
# interface PortChannel10
# no shutdown
# !
#
13 changes: 9 additions & 4 deletions models/enterprise_sonic/lag_interfaces/deleted_example_02.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

# Before state:
# -------------
# interface PortChannel 10
# !
# interface PortChannel 12
# !
# interface Eth1/10
# channel-group 10
# mtu 9100
Expand All @@ -17,6 +13,15 @@
# mtu 9100
# speed 100000
# no shutdown
# !
# interface PortChannel10
# no shutdown
# !
# evpn ethernet-segment auto-lacp
# df-preference 2222
# !
# interface PortChannel 12
#

- name: Deletes all LAGs and LAG attributes of all interfaces.
sonic_lag_interfaces:
Expand Down
21 changes: 17 additions & 4 deletions models/enterprise_sonic/lag_interfaces/merged_example_01.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
# speed 100000
# no shutdown
# !
# interface Eth1/15
# channel-group 12
# mtu 9100
# speed 100000
# interface PortChannel10
# no shutdown

- name: Merges provided configuration with device configuration.
Expand All @@ -21,6 +18,13 @@
members:
interfaces:
- member: Eth1/10
ethernet_segment:
esi_type: auto_lacp
df_preference: 2222
- name: PortChannel12
members:
interfaces:
- member: Eth1/15
state: merged

# After state:
Expand All @@ -37,3 +41,12 @@
# mtu 9100
# speed 100000
# no shutdown
# !
# interface PortChannel10
# no shutdown
# !
# evpn ethernet-segment auto-lacp
# df-preference 2222
# !
# interface PortChannel12
# no shutdown
29 changes: 22 additions & 7 deletions models/enterprise_sonic/lag_interfaces/overridden_example_01.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
# -------------
#
# interface Eth1/5
# channel-group 10
# interface Eth1/7
# channel-group 2
# channel-group 10
# !
# interface Eth1/6
# !
# interface PortChannel10
# no shutdown
# !
# evpn ethernet-segment auto-system-mac
# df-preference 2222
#

- name: Override device configuration of all LAG attributes of given interfaces on device with provided configuration.
sonic_lag_interfaces:
Expand All @@ -15,13 +22,21 @@
members:
interfaces:
- member: Eth1/6
ethernet_segment:
esi_type: auto_lacp
df_preference: 3333
state: overridden

# After state:
# ------------
# interface Eth1/7
no channel-group
# interface Eth1/5
no channel-group
# no channel-group
# !
# interface Eth1/6
# channel-group 20
# channel-group 20
# !
# interface PortChannel20
# no shutdown
# !
# evpn ethernet-segment auto-lacp
# df-preference 3333
46 changes: 40 additions & 6 deletions models/enterprise_sonic/lag_interfaces/replaced_example_01.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,58 @@
#
# interface Eth1/5
# channel-group 10
# interface Eth1/6
# channel-group 20
# !
# interface Eth1/7
# no channel-group
# mtu 9100
# speed 100000
# no shutdown
# !
# interface PortChannel10
# no shutdown
# !
# evpn ethernet-segment auto-lacp
# df-preference 2222

- name: Replace device configuration of specified LAG attributes of given interfaces with provided configuration.
sonic_lag_interfaces:
config:
- name: PortChannel20
members:
interfaces:
- member: Eth1/6
ethernet_segment:
esi_type: auto_system_mac
df_preference: 6666
- name: PortChannel10
members:
interfaces:
- member: Eth1/7
ethernet_segment:
esi_type: auto_system-mac
df_preference: 3333
state: replaced

# After state:
# ------------
#
# interface Eth1/7
# channel-group 10
# interface Eth1/5
# !
# interface Eth1/6
# channel-group 20
# interface Eth1/5
# no channel-group
# !
# interface Eth1/7
# channel-group 10
# !
# interface PortChannel10
# no shutdown
# !
# evpn ethernet-segment auto-system-mac
# df-preference 3333
# !
# interface PortChannel20
# no shutdown
# !
# evpn ethernet-segment auto-system-mac
# df-preference 6666
#
28 changes: 28 additions & 0 deletions models/enterprise_sonic/lag_interfaces/sonic_lag_interfaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,34 @@ DOCUMENTATION: |
choices:
- static
- lacp
ethernet_segment:
description:
- Specifies Ethernet segment.
version_added: 2.5.0
type: dict
suboptions:
esi_type:
description:
- Specifies type of Ethernet Segment Identifier.
- esi_type and esi can not be deleted separately.
- If both esi and df_preference are not present,
- deleted state will delete whole ethernet segment.
required: True
type: str
choices:
- auto_lacp
- auto_system_mac
- ethernet_segment_id
esi:
description:
- Specifies value of Ethernet Segment Identifier.
- Only "AUTO" is supported for auto_lacp and auto_system_mac.
type: str
df_preference:
description:
- The preference for Designated Forwarder election method.
- The range of df_preference value is from 1 to 65535.
type: int

state:
description:
Expand Down