community.network.cnos_static_route 模块 – 管理 Lenovo CNOS 网络设备上的静态 IP 路由
注意
此模块是 community.network 集合(版本 5.1.0)的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.network
。
要在 playbook 中使用它,请指定: community.network.cnos_static_route
。
注意
community.network 集合已被弃用,并将从 Ansible 12 中删除。有关详细信息,请参阅讨论主题。
已弃用
- 移除于:
版本 6.0.0
- 原因:
此集合及其中的所有内容均未维护且已弃用。
- 替代方案:
未知。
概要
此模块提供对 Lenovo CNOS 网络设备上的静态 IP 路由的声明式管理。
别名: network.cnos.cnos_static_route
参数
参数 |
注释 |
---|---|
静态路由的管理距离。 默认: |
|
静态路由定义的列表。 |
|
静态路由的名称 |
|
静态路由的接口。 |
|
静态路由的网络前缀掩码。 |
|
静态路由的下一跳 IP。 |
|
静态路由的网络前缀。 |
|
静态路由配置的状态。 选择
|
|
设置静态路由的标签。 |
注释
注意
已针对 CNOS 10.10.1 进行测试
示例
- name: Configure static route
community.network.cnos_static_route:
prefix: 10.241.107.0
mask: 255.255.255.0
next_hop: 10.241.106.1
- name: Configure ultimate route with name and tag
community.network.cnos_static_route:
prefix: 10.241.107.0
mask: 255.255.255.0
interface: Ethernet1/13
description: hello world
tag: 100
- name: Remove configuration
community.network.cnos_static_route:
prefix: 10.241.107.0
mask: 255.255.255.0
next_hop: 10.241.106.0
state: absent
- name: Add static route aggregates
community.network.cnos_static_route:
aggregate:
- { prefix: 10.241.107.0, mask: 255.255.255.0, next_hop: 10.241.105.0 }
- { prefix: 10.241.106.0, mask: 255.255.255.0, next_hop: 10.241.104.0 }
- name: Remove static route aggregates
community.network.cnos_static_route:
aggregate:
- { prefix: 10.241.107.0, mask: 255.255.255.0, next_hop: 10.241.105.0 }
- { prefix: 10.241.106.0, mask: 255.255.255.0, next_hop: 10.241.104.0 }
state: absent
返回值
常见的返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
要发送到设备的配置模式命令列表 返回: 始终 示例: |
状态
此模块将在版本 6.0.0 中删除。[已弃用]
有关更多信息,请参阅已弃用。