�
�Udac @` s d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z d d l m Z d d l m Z m Z d d l m Z m Z m Z m Z d d l m Z m Z m Z e Z d � Z e d k re � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust networkt supported_bys�
---
module: junos_static_route
version_added: "2.4"
author: "Ganesh Nalawade (@ganeshrn)"
short_description: Manage static IP routes on Juniper JUNOS network devices
description:
- This module provides declarative management of static
IP routes on Juniper JUNOS network devices.
options:
address:
description:
- Network address with prefix of the static route.
required: true
aliases: ['prefix']
next_hop:
description:
- Next hop IP of the static route.
required: true
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.
preference:
description:
- Global admin preference of the static route.
aliases: ['admin_distance']
qualified_preference:
description:
- Assign preference for qualified next hop.
aggregate:
description: List of static route definitions
state:
description:
- State of the static route configuration.
default: present
choices: ['present', 'absent']
active:
description:
- Specifies whether or not the configuration is active or deactivated
default: True
type: bool
requirements:
- ncclient (>=v0.5.2)
notes:
- This module requires the netconf system service be enabled on
the remote device being managed.
- Tested against vSRX JUNOS version 15.1X49-D15.4, vqfx-10000 JUNOS Version 15.1X53-D60.4.
- Recommended connection is C(netconf). See L(the Junos OS Platform Options,../network/user_guide/platform_junos.html).
- This module also works with C(local) connections for legacy playbooks.
extends_documentation_fragment: junos
s�
- 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
- name: delete static route
junos_static_route:
address: 192.168.2.0/24
state: absent
- 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
- 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
- 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
- name: Delete static route using aggregate
junos_static_route:
aggregate:
- address: 4.4.4.0/24
- address: 5.5.5.0/24
state: absent
s�
diff.prepared:
description: Configuration difference before and after applying change.
returned: when configuration is changed and diff option is enabled.
type: str
sample: >
[edit routing-options static]
route 2.2.2.0/24 { ... }
+ route 4.4.4.0/24 {
next-hop 3.3.3.3;
qualified-next-hop 5.5.5.5 {
+ preference 30;
}
+ preference 10;
+ }
N( t deepcopy( t
AnsibleModule( t remove_default_spec( t junos_argument_spect tostring( t load_configt map_params_to_objt map_obj_to_elet
to_param_list( t commit_configurationt discard_changest
locked_configc C` s] t d t d d g � d t � d t d d d d g � d t d d
� d t d d � d t d
d d d d g � d t d
t d d � � } t | � } t d t � | d <t | � t d t d d d d d | � d t d
t d d � � } | j | � | j t � d d g g } d d g g } t d | d | d | d t � } t � } i t d 6} | rn| | d <n d } t j
� } | j d i d! d"