community.general.cnos_static_route (0.1.1) — module

Manage static IP routes on Lenovo CNOS network devices

Authors: Anil Kumar Muraleedharan (@amuraleedhar)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

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
  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
  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
  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
  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
  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