Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/f5/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyc

�
�Udac@`s3ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZyddd
l
mZddlmZddlmZddlmZddlmZddlmZWnqek
rIdd
lmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ defd��YZ!de"fd ��YZ#d!e"fd"��YZ$d#e"fd$��YZ%d%�Z&e'd&kr/e&�nd'S((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_management_route
short_description: Manage system management routes on a BIG-IP
description:
  - Configures route settings for the management interface of a BIG-IP.
version_added: 2.6
options:
  name:
    description:
      - Specifies the name of the management route.
    type: str
    required: True
  description:
    description:
      - Description of the management route.
    type: str
  gateway:
    description:
      - Specifies that the system forwards packets to the destination through the
        gateway with the specified IP address.
    type: str
  network:
    description:
      - The subnet and netmask to be used for the route.
      - To specify that the route is the default route for the system, provide the
        value C(default).
      - Only one C(default) entry is allowed.
      - This parameter cannot be changed after it is set. Therefore, if you do need to change
        it, it is required that you delete and create a new route.
    type: str
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the resource exists.
      - When C(absent), ensures the resource is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s$
- name: Create a management route
  bigip_management_route:
    name: tacacs
    description: Route to TACACS
    gateway: 10.10.10.10
    network: 11.11.11.0/24
    state: present
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost
sv
description:
  description: The new description of the management route.
  returned: changed
  type: str
  sample: Route to TACACS
gateway:
  description: The new gateway of the management route.
  returned: changed
  type: str
  sample: 10.10.10.10
network:
  description: The new network to use for the management route.
  returned: changed
  type: str
  sample: default
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spec(tis_valid_ip(t
ip_networkt
ParameterscB`s;eZiZdddgZdddgZdddgZRS(tdescriptiontgatewaytnetwork(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRvs		t
ApiParameterscB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR�stModuleParameterscB`s&eZed��Zed��ZRS(cC`s�|jddkrdS|jddkr.dSy0tdjt|jd���}t|�SWntk
r}td��nXdS(NRtdefaultu{0}sQThe 'network' must either be a network address (with CIDR) or the word 'default'.(t_valuestNoneRtformattstrt
ValueErrorR(tselftaddr((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR�s"
cC`sE|jddkrdSt|jd�r5|jdStd��dS(NRs!The 'gateway' must an IP address.(RRRR(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR�s(RRtpropertyRR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R"tresultt
returnable((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt	to_return�s
(RRR+(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR%�st
UsableChangescB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR,�stReportableChangescB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR-�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R"R/R0((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R&tAttributeErrort_Difference__default(R"tparamR)((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R&R/R0R2(R"R4tattr1tattr2((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt	__default�s
cC`si|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkretd��ndS(Ns	0.0.0.0/0Rs,'network' cannot be changed after it is set.(R/RRR0R(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR�s$N(RRRR1R5R3R$R(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR.�s			t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetRR:R
R;tclientRR/RR0R,tchanges(R"targstkwargs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR1�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR;(RRR&R/RR,R>(R"tchangedtkey((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt_set_changed_options�scC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�t
d|�|_tSt
S(NR;(R.R/R0RRtdictR5Rt
isinstancetupdateR,R>tTruetFalse(R"tdiffRRAtktchange((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RLRGRH(R"R)((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt
should_updatescC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR;RA(RHRDR/tstateRNROR-R>R+RFt_announce_deprecations(R"RAR)RPt
reportableR>((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pytexec_module
s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR=R:t	deprecate(R"R)twarningstwarning((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRQs


cC`s$|j�r|j�S|j�SdS(N(texistsRFtcreate(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRN#s
cC`s|j�r|j�StS(N(R[tremoveRH(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRO)s
cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR0RMRHR:t
check_modeRGtupdate_on_device(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRF.s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(R:R_RGtremove_from_deviceR[R(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR]7s
cC`s(|j�|jjrtS|j�tS(N(RCR:R_RGtcreate_on_device(R"((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR\?s


cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wntk
rht	SX|j
dks�d|kr�|ddkr�t	StS(Ns0https://{0}:{1}/mgmt/tm/sys/management-route/{2}tservertserver_porti�tcode(RR=tproviderR/tnametapiR<tjsonR!RHRRG(R"turitresptresponse((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR[Fs


+cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��n|dS(
NRgt	partitions-https://{0}:{1}/mgmt/tm/sys/management-route/RcRdRiRei�i�tmessagetselfLink(i�i�(R>t
api_paramsR/RgRmRR=RfRhtpostRiR!RR tcontent(R"R;RjRkRltex((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRbUs 
cC`s�|jj�}dj|jjd|jjd|jj�}|jjj|d|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ndS(Ns0https://{0}:{1}/mgmt/tm/sys/management-route/{2}RcRdRiRei�Rn(R>RpRR=RfR/RgRhtpatchRiR!RR Rr(R"R;RjRkRlRs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR`ls

cC`sjdj|jjd|jjd|jj�}|jjj|�}|jdkrWtSt	|j
��dS(Ns0https://{0}:{1}/mgmt/tm/sys/management-route/{2}RcRdi�(RR=RfR/RgRhtdeleteRRGRRr(R"RjRl((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRas

cC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wn%tk
r{}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ntd|�S(Ns0https://{0}:{1}/mgmt/tm/sys/management-route/{2}RcRdRei�RnR;(
RR=RfR/RgRhR<RiR!RR RrR(R"RjRkRlRs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR^�s

(RRR1RCRLRMRSRQRNRORFR]R\R[RbR`RaR^(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR9�s 																tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dt�dt�dtddd	td
gf�dtddd
ddg��}i|_|jjt�|jj|�dS(NRgtrequiredRRRRmRtCommontfallbacktF5_PARTITIONRPRNtchoicesRO(RGtsupports_check_modeRDR	t
argument_specRFR
(R"R}((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyR1�s					(RRR1(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyRv�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR}R|R:RU(
RvRR}R|R9RSt	exit_jsonRt	fail_jsonR (tspecR:tmmtresultsRs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pytmain�s		t__main__N((t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
t)library.module_utils.network.f5.ipaddressRt%library.module_utils.compat.ipaddressRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont)ansible.module_utils.network.f5.ipaddresst%ansible.module_utils.compat.ipaddressRRRR%R,R-tobjectR.R9RvR�R(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_management_route.pyt<module>sF


3
!�	

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