ansible / ansible.builtin / v2.9.27 / module / cnos_static_route Manage static IP routes on Lenovo CNOS network devices | "added in version" 2.8 of ansible.builtin" Authors: Anil Kumar Muraleedharan (@amuraleedhar) preview | supported by communityansible.builtin.cnos_static_route (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
This module provides declarative management of static IP routes on Lenovo CNOS network devices.
- name: configure static route 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 cnos_static_route: prefix: 10.241.107.0 mask: 255.255.255.0 interface: Ethernet1/13 description: hello world tag: 100
- name: remove configuration 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 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 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
tag: description: - Set tag of the static route. mask: description: - Network prefix mask of the static route. state: choices: - present - absent default: present description: - State of the static route configuration. prefix: description: - Network prefix of the static route. next_hop: description: - Next hop IP of the static route. aggregate: description: List of static route definitions. interface: description: - Interface of the static route. description: aliases: - description description: - Name of the static route admin_distance: default: 1 description: - Admin distance of the static route.
commands: description: The list of configuration mode commands to send to the device returned: always sample: - ip route 10.241.107.0 255.255.255.0 10.241.106.0 type: list