Anons79 Mini Shell

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

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lmZd	dlmZd	dlm	Z	d	d
l
mZmZd	dl
mZmZd	dl
mZmZd�Zd�Zdd�Zd�Zedkr�e�ndS(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys9
---
module: ios_static_route
version_added: "2.4"
author: "Ricardo Carrillo Cruz (@rcarrillocruz)"
short_description: Manage static IP routes on Cisco IOS network devices
description:
  - This module provides declarative management of static
    IP routes on Cisco IOS network devices.
notes:
  - Tested against IOS 15.6
options:
  prefix:
    description:
      - Network prefix of the static route.
  mask:
    description:
      - Network prefix mask of the static route.
  next_hop:
    description:
      - Next hop IP of the static route.
  vrf:
    description:
      - VRF of the static route.
    version_added: "2.8"
  interface:
    description:
      - Interface of the static route.
    version_added: "2.8"
  name:
    description:
      - Name of the static route
    aliases: ['description']
    version_added: "2.8"
  admin_distance:
    description:
      - Admin distance of the static route.
  tag:
    description:
      - Set tag of the static route.
    version_added: "2.8"
  track:
    description:
      - Tracked item to depend on for the static route.
    version_added: "2.8"
  aggregate:
    description: List of static route definitions.
  state:
    description:
      - State of the static route configuration.
    default: present
    choices: ['present', 'absent']
extends_documentation_fragment: ios
sF
- name: configure static route
  ios_static_route:
    prefix: 192.168.2.0
    mask: 255.255.255.0
    next_hop: 10.0.0.1

- name: configure black hole in vrf blue depending on tracked item 10
  ios_static_route:
    prefix: 192.168.2.0
    mask: 255.255.255.0
    vrf: blue
    interface: null0
    track: 10

- name: configure ultimate route with name and tag
  ios_static_route:
    prefix: 192.168.2.0
    mask: 255.255.255.0
    interface: GigabitEthernet1
    name: hello world
    tag: 100

- name: remove configuration
  ios_static_route:
    prefix: 192.168.2.0
    mask: 255.255.255.0
    next_hop: 10.0.0.1
    state: absent

- name: Add static route aggregates
  ios_static_route:
    aggregate:
      - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
      - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }

- name: Remove static route aggregates
  ios_static_route:
    aggregate:
      - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
      - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
    state: absent
s�
commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  type: list
  sample:
    - ip route 192.168.2.0 255.255.255.0 10.0.0.1
i����(tdeepcopy(tfindall(t
AnsibleModule(tremove_default_spectvalidate_ip_address(t
get_configtload_config(tios_argument_spect
check_argsc
Cs�t�}x~|D]v}|d}|d=x�|D]�}|jd�r]|jd�r]|d=ntt|j��t|j��A�}|s�Pq.t|�dkr.|dd|ddko�dknr.|ds�|dj|d�r.Pq.q.Wd}d}|d}|d	}	|jd
�}
|
rMdj|d
|
||	f�}ndj|||	f�}x�dd
ddddgD]�}|j|�r~|dkr�t|j|�j��dkr�dj||d|j|�f�}q9|dkrdj|||j|�f�}q9dj||j|�f�}q~q~W|dkrc|rc|j	d|�q|dkr|r|j	|�qqW|S(Ntstatetadmin_distanceiiitnamesip routetprefixtmasktvrft t	interfacetnext_hopttagttracks"%s"tabsentsno %stpresent(snamestagstrack(
tlisttgettsettitemstlent
startswithtNonetjointsplittappend(twantthavetcommandstwRthtdifftcommandRRRtkey((sP/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.pytmap_obj_to_commands�s@	



(`

!-($%c
Cs]g}t|dd�}x>|j�D]0}td|�}|ddkrei|dd6}|d4n
i}|d4|d}|d	}|ji|d
6|d6dd
6�d}x�|dD]�}	|r�|	jd�||<d}q�t|	�r|jd|	�q�|	j�r|jd
|	�q�|	dkr4|	}q�|jd|	�q�W|j|�q%W|S(Ntflagss| include ip routes[^"\s]\S*|".+?"iRiiiiRRt1Rt"RRRRR(stagsnamestrack(	R
t
splitlinesRtupdateR!tstripR	tisdigitR$(
tmoduletobjtouttlinet
splitted_linetrouteRRt	next_wordtword((sP/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.pytmap_config_to_obj�s4


"		c
CsIddddddddd	d
g
}g}|jjd�}|r�x|D]�}|j�}x<|D]4}|j|�dkrb|jj|�||<qbqbWtd�|j�D��}|j||�|j|�qIWnk|j||j�t�}x?|D]7}|jj|�dk	r�|jj|�||<q�q�W|j|�|S(
NRRRRRRRRRRt	aggregatecss-|]#\}}|dk	r||fVqdS(N(R!(t.0tktv((sP/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.pys	<genexpr>�s(tparamsRtcopyR!tdictRt_check_required_togetherR$(R5trequired_togethertkeysR6R>titemR:R,((sP/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.pytmap_params_to_obj�s&$

	

cCstdtdd�dtdd�dtdd�dtdd�dtdd�dtddd	d
g�dtdd�dtdd�d
td
d�dtdddddg��
}t|�}tdt�|d<t|�tdtddddd|��}|j|�|jt�ddgg}ddgg}ddgg}td|d|d|dt�}t�}t||�it	d6}|r�||d<nt
|d|�}	t|�}
t|	|
�}||d <|r|j
s�t||�nt|d<n|j|�d!S("s+ main entry point for module execution
    RttypetstrRRRRRtaliasestdescriptionRRRRtdefaultRtchoicesRtrequiredR>RtelementsRDtoptionst
argument_spectrequired_one_oftmutually_exclusivetsupports_check_modetchangedtwarningsRFR'N(RDRtTrueRR2RRRR
tFalseRIR=R-t
check_modeRt	exit_json(telement_spectaggregate_specRSRTRFRUR5RXtresultR%R&R'((sP/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.pytmain�sN


		



	
t__main__N(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRCRtreRtansible.module_utils.basicRt)ansible.module_utils.network.common.utilsRR	t$ansible.module_utils.network.ios.iosR
RRR
R-R=R!RIR`t__name__(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.pyt<module>s"


8,		/	&	;

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