ansible.builtin.vyos_static_route (v2.4.6.0-1) — module

Manage static IP routes on Cisco VyOS network devices

| "added in version" 2.4 of ansible.builtin"

Authors: Trishna Guha (@trishnaguha)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

This module provides declarative management of static IP routes on Vyatta VyOS network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure static route
  vyos_static_route:
    prefix: 192.168.2.0
    mask: 24
    next_hop: 10.0.0.1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure static route prefix/mask
  vyos_static_route:
    prefix: 192.168.2.0/16
    next_hop: 10.0.0.1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove configuration
  vyos_static_route:
    prefix: 192.168.2.0
    mask: 16
    next_hop: 10.0.0.1
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure aggregates of static routes
  vyos_static_route:
    aggregate:
      - { prefix: 192.168.2.0, mask: 24, next_hop: 10.0.0.1 }
      - { prefix: 192.168.3.0, mask: 16, next_hop: 10.0.2.1 }
      - { prefix: 192.168.3.0/16, next_hop: 10.0.2.1 }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove static route collections
  vyos_static_route:
    aggregate:
      - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
      - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 }
    state: absent

Inputs

    
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. C(mask) param should be ignored if C(prefix)
      is provided with C(mask) value C(prefix/mask).

next_hop:
    description:
    - Next hop IP of the static route.

aggregate:
    description: List of static route definitions

admin_distance:
    description:
    - Admin distance of the static route.

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - set protocols static route 192.168.2.0/16 next-hop 10.0.0.1
  type: list