Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/junos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/junos/junos_static_route.pyo

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZddlmZmZddlmZmZmZmZddlmZmZmZeZd�Zedkre�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatustnetworkt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(tdeepcopy(t
AnsibleModule(tremove_default_spec(tjunos_argument_specttostring(tload_configtmap_params_to_objtmap_obj_to_elet
to_param_list(tcommit_configurationtdiscard_changest
locked_configcC`s]tdtddg�dt�dtddddg�d	tdd
�dtdd�dtd
ddddg�dtd
tdd��}t|�}tdt�|d<t|�tdtddddd|�dtd
tdd��}|j|�|jt�ddgg}ddgg}td|d|d|dt�}t�}itd6}|rn||d<nd }t	j
�}	|	jdid!d"6td#6fd0d1d	id!d"6d&d'6fdidd"6d&d'6fg�t|�}
t�}x�|
D]�}x7|D]/}
|j|
�d/kr|j|
||
<qqW|j�}|ddkr{|dr{|dr{|jd(d)�q{nt||	d*|�}|jt|||d*|��q�Wt|���x,|D]$}t|t|�|d+d,�}q�W|j}|rF|rt|�n
t|�t|d<|jrFi|d-6|d.<qFnWd/QX|j|�d/S(2s+ main entry point for module execution
    taddresstaliasestprefixtnext_hopt
preferencettypetinttadmin_distancetqualified_next_hoptstrtqualified_preferencetstatetdefaulttpresenttchoicestabsenttactivetbooltrequiredt	aggregatetlisttelementstdicttoptionstpurget
argument_spectrequired_one_oftmutually_exclusivetsupports_check_modetchangedtwarningssrouting-options/static/routetnametxpathtis_keysnext-hopspreference/metric-valuesqualified-next-hopttoptmsgs9parameters are required together: ['address', 'next_hop']tparamtactiontmergetpreparedtdiffN(Rsnext-hop(Rspreference/metric-value(R*tTrueRR
tFalsetupdateRR	R(tcollectionstOrderedDictRtgettNonetparamstcopyt	fail_jsonRtappendRRR
Rt
check_modeRRt_difft	exit_json(telement_spectaggregate_specR-R.R/tmoduleR2tresultR6tparam_to_xpath_mapRDtrequestsR8tkeytitemtwanttreqR<tcommit((sT/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_static_route.pytmain�st	


		

	

#

"



	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR@RERtansible.module_utils.basicR	t)ansible.module_utils.network.common.utilsR
t(ansible.module_utils.network.junos.junosRRR
RRRRRRR=tUSE_PERSISTENT_CONNECTIONRVt__name__(((sT/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_static_route.pyt<module>s$


62"	W

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]