community.network.cnos_static_route module – Manage static IP routes on Lenovo CNOS network devices
Note
This module is part of the community.network collection (version 5.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.cnos_static_route
.
Synopsis
This module provides declarative management of static IP routes on Lenovo CNOS network devices.
Parameters
Parameter |
Comments |
---|---|
Admin distance of the static route. Default: |
|
List of static route definitions. |
|
Name of the static route |
|
Interface of the static route. |
|
Network prefix mask of the static route. |
|
Next hop IP of the static route. |
|
Network prefix of the static route. |
|
State of the static route configuration. Choices:
|
|
Set tag of the static route. |
Notes
Note
Tested against CNOS 10.10.1
Examples
- 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
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The list of configuration mode commands to send to the device Returned: always Sample: |