community.network.slxos_l2_interface 模块 – 管理 Extreme Networks SLX-OS 设备上的二层接口。

注意

此模块是 community.network 集合 (版本 5.1.0) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.network

要在 playbook 中使用它,请指定: community.network.slxos_l2_interface

注意

community.network 集合已弃用,并将从 Ansible 12 中移除。请参阅 讨论主题 获取更多信息。

已弃用

在以下版本中移除:

6.0.0 版本

原因:

此集合及其中的所有内容均未维护且已弃用。

替代方案:

未知。

概要

  • 此模块提供对 Extreme slxos 设备上的二层接口的声明式管理。

别名:network.slxos.slxos_l2_interface

参数

参数

注释

access_vlan

字符串

在接入端口中配置给定的 VLAN。如果 mode=access,则用作接入 VLAN ID。

aggregate

字符串

二层接口定义列表。

mode

字符串

需要配置接口的模式。

选项

  • "access" ← (默认)

  • "trunk"

name

别名:interface

字符串 / 必需

接口的全名,不包括任何逻辑单元编号,例如 Ethernet 0/1。

native_vlan

字符串

在 trunk 端口中配置的本机 VLAN。如果 mode=trunk,则用作 trunk 本机 VLAN ID。

state

字符串

管理二层接口配置的状态。

选项

  • "present" ← (默认)

  • "absent"

  • "unconfigured"

trunk_allowed_vlans

字符串

给定 trunk 端口中允许的 VLAN 列表。如果 mode=trunk,则这些是将在 trunk 上配置的唯一 VLAN,例如“2-10,15”。

trunk_vlans

字符串

要在 trunk 端口中配置的 VLAN 列表。如果 mode=trunk,则用作要向 trunk 添加或从中删除的 VLAN 范围。

示例

- name: Ensure Ethernet 0/5 is in its default l2 interface state
  community.network.slxos_l2_interface:
    name: Ethernet 0/5
    state: unconfigured

- name: Ensure Ethernet 0/5 is configured for access vlan 20
  community.network.slxos_l2_interface:
    name: Ethernet 0/5
    mode: access
    access_vlan: 20

- name: Ensure Ethernet 0/5 only has vlans 5-10 as trunk vlans
  community.network.slxos_l2_interface:
    name: Ethernet 0/5
    mode: trunk
    native_vlan: 10
    trunk_vlans: 5-10

- name: Ensure Ethernet 0/5 is a trunk port and ensure 2-50 are being tagged (doesn't mean others aren't also being tagged)
  community.network.slxos_l2_interface:
    name: Ethernet 0/5
    mode: trunk
    native_vlan: 10
    trunk_vlans: 2-50

- name: Ensure these VLANs are not being tagged on the trunk
  community.network.slxos_l2_interface:
    name: Ethernet 0/5
    mode: trunk
    trunk_vlans: 51-4094
    state: absent

返回值

常见的返回值已在 此处 记录,以下是此模块独有的字段

描述

commands

列表 / 元素=字符串

要发送到设备的配置模式命令列表

返回:始终返回,但使用 Netconf 传输来管理设备的平台除外。

示例: ["interface Ethernet 0/5", "switchport access vlan 20"]

状态

  • 此模块将在 6.0.0 版本中移除。 *[已弃用]*

  • 有关更多信息,请参阅 已弃用

作者

  • Matthew Stone (@bigmstone)