community.network.cnos_static_route (5.0.2) — module

Manage static IP routes on Lenovo CNOS network devices

Authors: Anil Kumar Muraleedharan (@amuraleedhar)

Install collection

Install with ansible-galaxy collection install community.network:==5.0.2


Add to requirements.yml

  collections:
    - name: community.network
      version: 5.0.2

Description

This module provides declarative management of static IP routes on Lenovo CNOS network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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 }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
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.

Outputs

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