community.network.cnos_interface 模块 – 管理 Lenovo CNOS 网络设备上的接口
注意
此模块是 community.network 集合 (版本 5.1.0) 的一部分。
如果您使用的是 ansible
软件包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.network
。
要在剧本中使用它,请指定: community.network.cnos_interface
。
注意
community.network 集合已弃用,并将从 Ansible 12 中移除。有关更多信息,请参阅 讨论主题。
已弃用
- 在以下版本中移除:
6.0.0 版本
- 原因:
此集合及其中的所有内容均未维护且已弃用。
- 替代方案:
未知。
概要
此模块提供对 Lenovo CNOS 网络设备上接口的声明式管理。
别名:network.cnos.cnos_interface
参数
参数 |
注释 |
---|---|
接口定义列表。 |
|
在检查远程设备上的运行状态之前等待的时间(以秒为单位)。此等待适用于运行状态参数,这些参数是值为 默认值: |
|
接口描述。 |
|
接口链路状态 选项
|
|
接口链路状态。 选项
|
|
最大传输数据包大小。 |
|
接口名称。 |
|
检查给定接口 可以使用以下子选项。 |
|
给定接口 |
|
接口 |
|
接口链路速度。 |
|
接口配置的状态, 选项
|
|
备注
注意
已针对 CNOS 10.8.1 进行测试
示例
- name: Configure interface
community.network.cnos_interface:
name: Ethernet1/33
description: test-interface
speed: 100
duplex: half
mtu: 999
- name: Remove interface
community.network.cnos_interface:
name: loopback3
state: absent
- name: Make interface up
community.network.cnos_interface:
name: Ethernet1/33
enabled: true
- name: Make interface down
community.network.cnos_interface:
name: Ethernet1/33
enabled: false
- name: Check intent arguments
community.network.cnos_interface:
name: Ethernet1/33
state: up
tx_rate: ge(0)
rx_rate: le(0)
- name: Check neighbors intent arguments
community.network.cnos_interface:
name: Ethernet1/33
neighbors:
- port: eth0
host: netdev
- name: Config + intent
community.network.cnos_interface:
name: Ethernet1/33
enabled: false
state: down
- name: Add interface using aggregate
community.network.cnos_interface:
aggregate:
- { name: Ethernet1/33, mtu: 256, description: test-interface-1 }
- { name: Ethernet1/44, mtu: 516, description: test-interface-2 }
duplex: full
speed: 100
state: present
- name: Delete interface using aggregate
community.network.cnos_interface:
aggregate:
- name: loopback3
- name: loopback6
state: absent
返回值
常见返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
发送到设备的配置模式命令列表。 返回值: 始终返回,但使用 Netconf 传输来管理设备的平台除外。 示例: |
状态
此模块将在 6.0.0 版本中移除。[已弃用]
更多信息请参见 已弃用。