ansible.builtin.junos_static_route (v2.4.2.0-1) — module

Manage static IP routes on Juniper JUNOS network devices

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

Authors: Ganesh Nalawade (@ganeshrn)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.4.2.0.post1

Description

This module provides declarative management of static IP routes on Juniper JUNOS network devices.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure static route
  junos_static_route:
    address: 192.168.2.0/24
    next_hop: 10.0.0.1
    preference: 10
    qualified_next_hop: 10.0.0.2
    qualified_preference: 3
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: delete static route
  junos_static_route:
    address: 192.168.2.0/24
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: deactivate static route configuration
  junos_static_route:
    address: 192.168.2.0/24
    next_hop: 10.0.0.1
    preference: 10
    qualified_next_hop: 10.0.0.2
    qualified_preference: 3
    state: present
    active: False
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: activate static route configuration
  junos_static_route:
    address: 192.168.2.0/24
    next_hop: 10.0.0.1
    preference: 10
    qualified_next_hop: 10.0.0.2
    qualified_preference: 3
    state: present
    active: True
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure static route using aggregate
  junos_static_route:
    aggregate:
    - { address: 4.4.4.0/24, next_hop: 3.3.3.3, qualified_next_hop: 5.5.5.5, qualified_preference: 30 }
    - { address: 5.5.5.0/24, next_hop: 6.6.6.6, qualified_next_hop: 7.7.7.7, qualified_preference: 12 }
    preference: 10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete static route using aggregate
  junos_static_route:
    aggregate:
    - address: 4.4.4.0/24
    - address: 5.5.5.0/24
    state: absent

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the static route configuration.

active:
    choices:
    - true
    - false
    default: true
    description:
    - Specifies whether or not the configuration is active or deactivated

address:
    aliases:
    - prefix
    description:
    - Network address with prefix of the static route.
    required: true

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

aggregate:
    description: List of static route definitions

preference:
    aliases:
    - admin_distance
    description:
    - Global admin preference of the static route.

qualified_next_hop:
    description:
    - Qualified next hop IP of the static route. Qualified next hops allow to associate
      preference with a particular next-hop address.

qualified_preference:
    description:
    - Assign preference for qualified next hop.

Outputs

diff.prepared:
  description: Configuration difference before and after applying change.
  returned: when configuration is changed and diff option is enabled.
  sample: "[edit routing-options static]\n     route 2.2.2.0/24 { ... }\n+    route\
    \ 4.4.4.0/24 {\n        next-hop 3.3.3.3;\n        qualified-next-hop 5.5.5.5\
    \ {\n+            preference 30;\n         }\n+        preference 10; +    }\n"
  type: string