community.network.cnos_l2_interface 模块 – 管理联想 CNOS 设备上的二层接口。
注意
此模块是 community.network 集合 (版本 5.1.0) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.network
。
要在 playbook 中使用它,请指定: community.network.cnos_l2_interface
。
注意
community.network 集合已被弃用,并将从 Ansible 12 中移除。有关更多信息,请参阅 讨论主题。
已弃用
- 在以下版本中移除:
6.0.0 版本
- 原因:
此集合及其中的所有内容均未维护且已弃用。
- 替代方案:
未知。
概要
此模块提供对联想 CNOS 设备上二层接口的声明式管理。
别名:network.cnos.cnos_l2_interface
参数
参数 |
注释 |
---|---|
在接入端口中配置给定的 VLAN。如果 |
|
二层接口定义列表。 |
|
需要配置接口的模式。 选项
|
|
接口的全名,不包括任何逻辑单元号,例如 Ethernet1/3。 |
|
在 trunk 端口中配置的原生 VLAN。如果 |
|
管理二层接口配置的状态。 选项
|
|
给定 trunk 端口中允许的 VLAN 列表。如果 |
|
要在 trunk 端口中配置的 VLAN 列表。如果 |
示例
- name: Ensure Ethernet1/5 is in its default l2 interface state
community.network.cnos_l2_interface:
name: Ethernet1/5
state: unconfigured
- name: Ensure Ethernet1/5 is configured for access vlan 20
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: access
access_vlan: 20
- name: Ensure Ethernet1/5 only has vlans 5-10 as trunk vlans
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: trunk
native_vlan: 10
trunk_vlans: 5-10
- name: Ensure Ethernet1/5 is a trunk port and ensure 2-50 are being tagged
(doesn't mean others aren't also being tagged)
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: trunk
native_vlan: 10
trunk_vlans: 2-50
- name: Ensure these VLANs are not being tagged on the trunk
community.network.cnos_l2_interface:
name: Ethernet1/5
mode: trunk
trunk_vlans: 51-4094
state: absent
返回值
公共返回值已在此处记录,以下是此模块独有的字段
键 |
描述 |
---|---|
要发送到设备的配置模式命令列表 返回:始终返回,但使用 Netconf 传输来管理设备的平台除外。 示例: |
状态
此模块将在 6.0.0 版本中移除。 *[已弃用]*
有关更多信息,请参见 已弃用。