модуль dellemc.enterprise_sonic.sonic_br_l2pt — управление конфигурациями L2PT в SONiC
Примечание
Этот модуль входит в состав коллекции dellemc.enterprise_sonic (версия 3.2.0).
Возможно, эта коллекция уже установлена, если вы используете пакет ansible. Она не входит в ansible-core. Чтобы проверить, установлена ли она, выполните ansible-galaxy collection list.
Чтобы установить её, используйте: ansible-galaxy collection install dellemc.enterprise_sonic.
Чтобы использовать её в плейбуке, укажите: dellemc.enterprise_sonic.sonic_br_l2pt.
Добавлено в dellemc.enterprise_sonic 3.1.0
Краткое описание
- Этот модуль обеспечивает управление конфигурацией параметров L2PT на устройствах под управлением SONiC.
Параметры
Параметр | Комментарии |
|---|---|
config list / elements=dictionary | Список конфигураций L2PT. |
|
bridge_l2pt_params list / elements=dictionary |
Список идентификаторов VLAN для каждого поддерживаемого протокола уровня 2. |
|
protocol string / обязательный |
Протокол уровня 2. Варианты:
|
|
vlan_ids list / elements=string |
Список идентификаторов VLAN, через которые должны туннелироваться пакеты протокола уровня 2. Диапазоны можно указывать в списке идентификаторов VLAN с помощью разделителя «-». |
|
name string / обязательный |
Имя интерфейса для конфигурации L2PT. |
state string | Состояние конфигурации после выполнения модуля. Варианты:
|
Примечания
Примечание
- Протестировано на Enterprise SONiC Distribution от Dell Technologies.
- Поддерживает
check_mode.
Примеры
# Using "merged" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 10
- name: Modify interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LACP'
vlan_ids:
- 10-12
- protocol: 'CDP'
vlan_ids:
- 20
- 40-60
- protocol: 'STP'
vlan_ids:
- 25-26
state: merged
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel lldp Vlan 10
# switchport l2proto-tunnel stp Vlan 25-26
# Using "merged" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel cdp Vlan 20, 40-50
# switchport l2proto-tunnel lacp Vlan 10-11
# switchport l2proto-tunnel lldp Vlan 10
# switchport l2proto-tunnel stp Vlan 25-26
- name: Modify interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LLDP'
vlan_ids:
- 12
- protocol: 'LACP'
vlan_ids:
- 12
- protocol: 'CDP'
vlan_ids:
- 20
- 45-60
- protocol: 'STP'
vlan_ids:
- 20-21
state: merged
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel lldp Vlan 10,12
# switchport l2proto-tunnel stp Vlan 20-21,25-26
# Using "deleted" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
- name: Delete interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LACP'
vlan_ids:
- 10-12
state: deleted
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
# Using "deleted" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 100
# switchport l2proto-tunnel stp Vlan 100-150
- name: Delete all interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
state: deleted
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# Using "deleted" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
- name: Delete L2PT configurations for protocol
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LACP'
- protocol: 'CDP'
vlan_ids: []
state: deleted
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel stp Vlan 25-26
# Using "deleted" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
- name: Delete interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LACP'
vlan_ids:
- 11
- protocol: 'CDP'
vlan_ids:
- 40-50
state: deleted
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10,12
# switchport l2proto-tunnel cdp Vlan 20,51-60
# switchport l2proto-tunnel stp Vlan 25-26
# Using "deleted" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
- name: Delete L2PT configurations for entire interface
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params: []
- name: Ethernet8
state: deleted
# After state:
# ------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# Using "replaced" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel stp Vlan 25-26
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 100
# switchport l2proto-tunnel stp Vlan 100-150
- name: Replace interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LLDP'
vlan_ids:
- 10-12
- protocol: 'LACP'
vlan_ids:
- 8
- 12-14
- protocol: 'CDP'
vlan_ids:
- 20-45
state: replaced
# After state:
# ------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 10-12
# switchport l2proto-tunnel lacp Vlan 8,12-14
# switchport l2proto-tunnel cdp Vlan 20-45
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 100
# switchport l2proto-tunnel stp Vlan 100-150
# Using "overridden" state
#
# Before state:
# -------------
# sonic# show running-configuration interface Ethernet 0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 10
# switchport l2proto-tunnel lacp Vlan 15-50
# switchport l2proto-tunnel cdp 20
# switchport l2proto-tunnel stp 25-26
# sonic# show running-configuration interface Ethernet 8
# !
# interface Ethernet8
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel lldp Vlan 100
# switchport l2proto-tunnel stp Vlan 100-150
- name: Override interface L2PT configurations
dellemc.enterprise_sonic.sonic_br_l2pt:
config:
- name: Ethernet0
bridge_l2pt_params:
- protocol: 'LACP'
vlan_ids:
- 10-12
- protocol: 'CDP'
vlan_ids:
- 20
- 40-60
- protocol: 'STP'
vlan_ids:
- 25-26
state: overridden
# After state:
# ------------
# sonic# show running-configuration interface Ethernet0
# !
# interface Ethernet0
# mtu 9100
# speed 400000
# fec RS
# unreliable-los auto
# no shutdown
# switchport l2proto-tunnel cdp Vlan 20,40-60
# switchport l2proto-tunnel lacp Vlan 10-12
# switchport l2proto-tunnel stp Vlan 25-26
Возвращаемые значения
Общие возвращаемые значения описаны здесь; ниже перечислены поля, уникальные для этого модуля:
Ключ | Описание |
|---|---|
after list / elements=string | Конфигурация, полученная в результате вызова модуля. Возвращается: при изменении |
after(generated) list / elements=string | Конфигурация, которая была бы получена при вызове модуля вне режима проверки. Возвращается: когда |
before list / elements=string | Конфигурация до вызова модуля. Возвращается: всегда |
commands list / elements=string | Набор команд, отправленных на удалённое устройство. В режиме Возвращается: всегда Пример: |
Ссылки на коллекцию
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/dellemc/enterprise_sonic/sonic_br_l2pt_module.html