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_traffic_selector.pyo

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
lm
Z
y�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZ defd��YZ!defd��YZ"de"fd��YZ#d e"fd!��YZ$d"e%fd#��YZ&d$e%fd%��YZ'd&e%fd'��YZ(d(�Z)e*d)kr{e)�ndS(*i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_byst
---
module: bigip_traffic_selector
short_description: Manage IPSec Traffic Selectors on BIG-IP
description:
  - Manage IPSec Traffic Selectors on BIG-IP.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the traffic selector.
    type: str
    required: True
  destination_address:
    description:
      - Specifies the host or network IP address to which the application traffic is destined.
      - When creating a new traffic selector, this parameter is required.
    type: str
  source_address:
    description:
      - Specifies the host or network IP address from which the application traffic originates.
      - When creating a new traffic selector, this parameter is required.
    type: str
  ipsec_policy:
    description:
      - Specifies the IPsec policy that tells the BIG-IP system how to handle the packets.
      - When creating a new traffic selector, if this parameter is not specified, the default
        is C(default-ipsec-policy).
    type: str
  order:
    description:
      - Specifies the order in which traffic is matched, if traffic can be matched to multiple
        traffic selectors.
      - Traffic is matched to the traffic selector with the highest priority (lowest order number).
      - When creating a new traffic selector, if this parameter is not specified, the default
        is C(last).
    type: int
  description:
    description:
      - Description of the traffic selector.
    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 traffic selector
  bigip_traffic_selector:
    name: selector1
    destination_address: 1.1.1.1
    ipsec_policy: policy1
    order: 1
    source_address: 2.2.2.2
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
destination_address:
  description: The new Destination IP Address.
  returned: changed
  type: str
  sample: 1.2.3.4/32
source_address:
  description: The new Source IP address.
  returned: changed
  type: str
  sample: 2.3.4.5/32
ipsec_policy:
  description: The new IPSec policy.
  returned: changed
  type: str
  sample: /Common/policy1
order:
  description: The new sort order.
  returned: changed
  type: int
  sample: 1
N(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tip_interface(tcmp_str_with_nonet
ParameterscB`sbeZidd6dd6dd6ZdddddgZdddddgZdddddgZRS(tdestination_addresstdestinationAddresstsource_addresst
sourceAddresstipsec_policytipsecPolicytordertdescription(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�s&
		t
ApiParameterscB`seZed��ZRS(cC`s"|jddkrdS|jdS(NRtnone(NR"(t_valuestNone(tself((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�s(RRtpropertyR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR!�stModuleParameterscB`sMeZed��Zed��Zed��Zed��Zd�ZRS(cC`s.|jddkrdSt|j|jd�S(NR(R#R$R
t	partition(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�scC`s.|jd�}|dkr*td��n|S(NRi����s-No IP address found in 'destination_address'.(t_format_addressR(R%tresult((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�s
cC`s.|jd�}|dkr*td��n|S(NRi����s(No IP address found in 'source_address'.(R)R(R%R*((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�s
cC`s9|jddkrdS|jddkr.dS|jdS(NRR"t(snoneR+(R#R$(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�s
c	C`s>|j|dkrdSd}d|j|krtj||j|�}|sSdS|jd�}|dkrrdS|jd�}|jd�}|dk	r�tdj||��}ntdj|��}|r�d	jt|j�||j	j
�}n!d
jt|j�|j	j
�}|Sttdj|j|���S(Ns0(?P<addr>[^%/]+)(%(?P<rd>\d+))?(/(?P<cidr>\d+))?t%taddri����tcidrtrdu{0}/{1}u{0}s{0}%{1}/{2}s{0}/{1}(R#R$tretmatchtgroupRtformattstrtiptnetworkt	prefixlen(	R%ttypetpatterntmatchesR-R.R/R5R*((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR)�s('!(RRR&RRRRR)(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR'�s
		tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R%R*t
returnable((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyt	to_return�s
(RRR@(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR;�st
UsableChangescB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRA�stReportableChangescB`seZRS((RR(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRB�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R%RDRE((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.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_traffic_selector.pytcompares

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R<RDRERG(R%RItattr1tattr2((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyt	__defaults
cC`st|jj|jj�S(N(RRDRRE(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRsN(RRR$RFRJRHR&R(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRCs			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(tgetR$ROR
RPtclientR'RDR!RERAtchanges(R%targstkwargs((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRFs
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRP(RRR<RDR$RARS(R%tchangedtkey((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.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(NRP(RCRDRERR tdictRJR$t
isinstancetupdateRARStTruetFalse(R%tdiffR RVtktchange((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyt_update_changed_options,s		
cC`s|j�}|rtStS(N(RaR\R](R%R*((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyt
should_update>scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRPRV(R]RYRDtstateRcRdRBRSR@R[t_announce_deprecations(R%RVR*Ret
reportableRS((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pytexec_moduleDs	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRRROt	deprecate(R%R*twarningstwarning((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRfUs


cC`s$|j�r|j�S|j�SdS(N(texistsR[tcreate(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRc]s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns6https://{0}:{1}/mgmt/tm/net/ipsec/traffic-selector/{2}tservertserver_porti�tcode(R3RRtproviderRRDR(tnametapiRQtjsont
ValueErrorR]RR\(R%turitresptresponse((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRpcs


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRERbR]ROt
check_modeR\tupdate_on_device(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR[rs
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(ROR~R\tremove_from_deviceRpR(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pytremove{s
cC`s(|j�|jjrtS|j�tS(N(RXROR~R\tcreate_on_device(R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRq�s


cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��ndS(NRvR(s3https://{0}:{1}/mgmt/tm/net/ipsec/traffic-selector/RrRsRxRti�i�tmessage(i�i�(RSt
api_paramsRDRvR(R3RRRuRwtpostRxRyRR4tcontent(R%RPRzR{R|tex((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR��s
cC`s�|jj�}dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��ndS(Ns6https://{0}:{1}/mgmt/tm/net/ipsec/traffic-selector/{2}RrRsRxRti�R�(RSR�R3RRRuRRDR(RvRwtpatchRxRyRR4R�(R%RPRzR{R|R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR�s

cC`s|j�r|j�StS(N(RpR�R](R%((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRd�s
cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns6https://{0}:{1}/mgmt/tm/net/ipsec/traffic-selector/{2}RrRsi�(R3RRRuRRDR(RvRwtdeleteRR\(R%RzR{((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR��s

cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd|�S(Ns6https://{0}:{1}/mgmt/tm/net/ipsec/traffic-selector/{2}RrRsRti�R�RP(R3RRRuRRDR(RvRwRQRxRyRR4R�R!(R%RzR{R|R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR}�s

(RRRFRXRaRbRhRfRcRpR[R�RqR�RRdR�R}(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRNs 																
tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dt�dt�dtdd�d	t�d
tddd
ddg�dtdddtdgf��}i|_|jjt�|jj|�dS(NRvtrequiredRRRRR8tintRRetdefaultRctchoicesRdR(tCommontfallbacktF5_PARTITION(R\tsupports_check_modeRYR	t
argument_specR[R(R%R�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyRF�s"						(RRRF(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RORj(
R�RR�R�RNRht	exit_jsonRt	fail_jsonR4(tspecROtmmtresultsR�((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pytmain�s		t__main__(+t
__future__RRRR8t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR0tansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RRt%library.module_utils.compat.ipaddressRt'library.module_utils.network.f5.compareRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont%ansible.module_utils.compat.ipaddresst'ansible.module_utils.network.f5.compareRR!R'R;RARBtobjectRCRNR�R�R(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_traffic_selector.pyt<module>sP


=
 ;�	

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