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_ike_peer.pyc

�
�Udac@`ssddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZy�dd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�dd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ defd ��YZ!d!e"fd"��YZ#d#e"fd$��YZ$d%e"fd&��YZ%d'�Z&e'd(kroe&�nd)S(*i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys+
---
module: bigip_ike_peer
short_description: Manage IPSec IKE Peer configuration on BIG-IP
description:
  - Manage IPSec IKE Peer configuration on BIG-IP.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the IKE peer.
    type: str
    required: True
  description:
    description:
      - Description of the IKE peer.
    type: str
  version:
    description:
      - Specifies which version of IKE is used.
      - If the system you are configuring is the IPsec initiator, and you select
        both versions, the system tries using IKEv2 for negotiation. If the remote
        peer does not support IKEv2, the IPsec tunnel fails. To use IKEv1 in this
        case, you must deselect Version 2 and try again.
      - If the system you are configuring is the IPsec responder, and you select
        both versions, the IPsec initiator system determines which IKE version to use.
      - When creating a new IKE peer, this value is required.
    type: list
    choices:
      - v1
      - v2
  presented_id_type:
    description:
      - Specifies the identifier type that the local system uses to identify
        itself to the peer during IKE Phase 1 negotiations.
    type: str
    choices:
      - address
      - asn1dn
      - fqdn
      - keyid-tag
      - user-fqdn
      - override
  presented_id_value:
    description:
      - This is a required value when C(version) includes (Cv2).
      - Specifies a value for the identity when using a C(presented_id_type) of
        C(override).
    type: str
  verified_id_type:
    description:
      - Specifies the identifier type that the local system uses to identify
        the peer during IKE Phase 1 negotiation.
      - This is a required value when C(version) includes (Cv2).
      - When C(user-fqdn), value of C(verified_id_value) must be in the form of
        User @ DNS domain string.
    type: str
    choices:
      - address
      - asn1dn
      - fqdn
      - keyid-tag
      - user-fqdn
      - override
  verified_id_value:
    description:
      - This is a required value when C(version) includes (Cv2).
      - Specifies a value for the identity when using a C(verified_id_type) of
        C(override).
    type: str
  phase1_auth_method:
    description:
      - Specifies the authentication method for phase 1 negotiation.
      - When creating a new IKE peer, if this value is not specified, the default is
        C(rsa-signature).
    type: str
    choices:
      - pre-shared-key
      - rsa-signature
  phase1_cert:
    description:
      - Specifies the digital certificate to use for the RSA signature.
      - When creating a new IKE peer, if this value is not specified, and
        C(phase1_auth_method) is C(rsa-signature), the default is C(default.crt).
      - This parameter is invalid when C(phase1_auth_method) is C(pre-shared-key).
    type: str
  phase1_key:
    description:
      - Specifies the public key that the digital certificate contains.
      - When creating a new IKE peer, if this value is not specified, and
        C(phase1_auth_method) is C(rsa-signature), the default is C(default.key).
      - This parameter is invalid when C(phase1_auth_method) is C(pre-shared-key).
    type: str
  phase1_verify_peer_cert:
    description:
      - In IKEv2, specifies whether the certificate sent by the IKE peer is verified
        using the Trusted Certificate Authorities, a CRL, and/or a peer certificate.
      - In IKEv1, specifies whether the identifier sent by the peer is verified with
        the credentials in the certificate, in the following manner - ASN1DN; specifies
        that the entire certificate subject name is compared with the identifier.
        Address, FQDN, or User FQDN; specifies that the certificate's subjectAltName is
        compared with the identifier. If the two do not match, the negotiation fails.
      - When creating a new IKE peer, if this value is not specified, and
        C(phase1_auth_method) is C(rsa-signature), the default is C(no).
      - This parameter is invalid when C(phase1_auth_method) is C(pre-shared-key).
    type: bool
  preshared_key:
    description:
      - Specifies a string that the IKE peers share for authenticating each other.
      - This parameter is only relevant when C(phase1_auth_method) is C(pre-shared-key).
      - This parameter is invalid when C(phase1_auth_method) is C(rsa-signature).
    type: str
  remote_address:
    description:
      - Displays the IP address of the BIG-IP system that is remote to the system
        you are configuring.
    type: str
  phase1_encryption_algorithm:
    description:
      - Specifies the algorithm to use for IKE encryption.
      - IKE C(version) C(v2) does not support C(blowfish), C(camellia), or C(cast128).
    type: str
    choices:
      - 3des
      - des
      - blowfish
      - cast128
      - aes128
      - aes192
      - aes256
      - camellia
  phase1_hash_algorithm:
    description:
      - Specifies the algorithm to use for IKE authentication.
    type: str
    choices:
      - sha1
      - md5
      - sha256
      - sha384
      - sha512
  phase1_perfect_forward_secrecy:
    description:
      - Specifies the Diffie-Hellman group to use for IKE Phase 1 and Phase 2 negotiations.
    type: str
    choices:
      - ecp256
      - ecp384
      - ecp521
      - modp768
      - modp1024
      - modp1536
      - modp2048
      - modp3072
      - modp4096
      - modp6144
      - modp8192
  update_password:
    description:
      - C(always) will allow to update passwords if the user chooses to do so.
        C(on_create) will only set the password for newly created IKE peers.
    type: str
    choices:
      - always
      - on_create
    default: always
  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 new IKE peer
  bigip_ike_peer:
    name: ike1
    remote_address: 1.2.3.4
    version:
      - v1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Change presented id type - keyid-tag
  bigip_ike_peer:
    name: ike1
    presented_id_type: keyid-tag
    presented_id_value: key1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove IKE peer
  bigip_ike_peer:
    name: ike1
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
presented_id_type:
  description: The new Presented ID Type value of the resource.
  returned: changed
  type: str
  sample: address
verified_id_type:
  description: The new Verified ID Type value of the resource.
  returned: changed
  type: str
  sample: address
phase1_auth_method:
  description: The new IKE Phase 1 Credentials Authentication Method value of the resource.
  returned: changed
  type: str
  sample: rsa-signature
remote_address:
  description: The new Remote Address value of the resource.
  returned: changed
  type: str
  sample: 1.2.2.1
version:
  description: The new list of IKE versions.
  returned: changed
  type: list
  sample: ['v1', 'v2']
phase1_encryption_algorithm:
  description: The new IKE Phase 1 Encryption Algorithm.
  returned: changed
  type: str
  sample: 3des
phase1_hash_algorithm:
  description: The new IKE Phase 1 Authentication Algorithm.
  returned: changed
  type: str
  sample: sha256
phase1_perfect_forward_secrecy:
  description: The new IKE Phase 1 Perfect Forward Secrecy.
  returned: changed
  type: str
  sample: modp1024
phase1_cert:
  description: The new IKE Phase 1 Certificate Credentials.
  returned: changed
  type: str
  sample: /Common/cert1.crt
phase1_key:
  description: The new IKE Phase 1 Key Credentials.
  returned: changed
  type: str
  sample: /Common/cert1.key
phase1_verify_peer_cert:
  description: The new IKE Phase 1 Key Verify Peer Certificate setting.
  returned: changed
  type: bool
  sample: yes
verified_id_value:
  description: The new Verified ID Value setting for the Verified ID Type.
  returned: changed
  type: str
  sample: 1.2.3.1
presented_id_value:
  description: The new Presented ID Value setting for the Presented ID Type.
  returned: changed
  type: str
  sample: 1.2.3.1
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tflatten_boolean(tcmp_str_with_nonet
ParameterscB`seZidd6dd6dd6dd6dd	6d
d
6dd6d
d6dd6dd6dd6dd6dd6dd6Zddddd	d
dddddddddgZdddddd
dd
dddddddgZdddddd
dd
dddddddgZed��ZRS(tpresented_id_typetmyIdTypetverified_id_typetpeersIdTypetphase1_auth_methodtphase1AuthMethodt
preshared_keytpresharedKeyEncryptedtremote_addresst
remoteAddresstversiontphase1_encryption_algorithmtphase1EncryptAlgorithmtphase1_hash_algorithmtphase1HashAlgorithmtphase1_perfect_forward_secrecytphase1PerfectForwardSecrecytphase1_certt
myCertFilet
phase1_keyt
myCertKeyFiletphase1_verify_peer_certt
verifyCerttverified_id_valuetpeersIdValuetpresented_id_valuet	myIdValuetdescriptioncC`st|jd�S(NR((Rt_values(tself((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR(�s(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyR((((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRGsz
			t
ApiParameterscB`seZed��ZRS(cC`s"|jddkrdS|jdS(NR.tnone(NR9(R/tNone(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR.�s(R1R2R7R.(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR8�stModuleParameterscB`s5eZed��Zed��Zed��ZRS(cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NR$tR9(R<snone(R/R:R
t	partition(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR$�s
cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NR&R<R9(R<snone(R/R:R
R=(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR&�s
cC`s9|jddkrdS|jddkr.dS|jdS(NR.R9R<(snoneR<(R/R:(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR.�s
(R1R2R7R$R&R.(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR;�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R5tgetattrt_filter_paramst	Exception(R0tresultt
returnable((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyt	to_return�s
(R1R2RD(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR>�st
UsableChangescB`seZed��ZRS(cC`s6|jddkrdS|jddkr.dSdSdS(NR(tyesttruetfalse(R/R:(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR(�s
(R1R2R7R((((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRE�stReportableChangescB`s&eZed��Zed��ZRS(cC`st|jd�S(NR((RR/(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR(�scC`sdS(N(R:(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR�s(R1R2R7R(R(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRI�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R0RKRL((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R?tAttributeErrort_Difference__default(R0tparamRB((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R?RKRLRN(R0RPtattr1tattr2((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyt	__default�s
cC`st|jj|jj�S(N(RRKR.RL(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR.�sN(R1R2R:RMRQROR7R.(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRJ�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(tgetR:RVR
RWtclientR;RKR8RLREtchanges(R0targstkwargs((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRM�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRW(RR5R?RKR:RERZ(R0tchangedtkey((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.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(NRW(RJRKRLRR6tdictRQR:t
isinstancetupdateRERZtTruetFalse(R0tdiffR6R]tktchange((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyt_update_changed_optionss		
cC`s|j�}|rtStS(N(RhRcRd(R0RB((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyt
should_updatescC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRWR](RdR`RKtstateRjRkRIRZRDRbt_announce_deprecations(R0R]RBRlt
reportableRZ((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pytexec_modules	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgR(tpopRYRVt	deprecate(R0RBtwarningstwarning((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRm*s


cC`s$|j�r|j�S|j�SdS(N(texistsRbtcreate(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRj2s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns.https://{0}:{1}/mgmt/tm/net/ipsec/ike-peer/{2}tservertserver_porti�tcode(tformatRYtproviderRRKR=tnametapiRXtjsont
ValueErrorRdRRc(R0turitresptresponse((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRv8s


+cC`s|j�|_|jjdk	rHt|jj�dkrHtd��n|jjdkr�|jjdkr�|jjdkr�td��q�n|j	j
dkr�|j	ji|j	jd6�n|j	jr�|j	jd=n|j
�s�tS|jjr�tS|j�tS(Nis-At least one version value must be specified.spre-shared-keys[A 'preshared_key' must be specified when changing 'phase1_auth_method' to 'pre-shared-key'.talwaysR(tread_current_from_deviceRLRZRR:tlenRRRRKtupdate_passwordRbR/RiRdRVt
check_modeRctupdate_on_device(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRbGs$*$ 
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RVR�Rctremove_from_deviceRvR(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pytremovecs
cC`s�|j�|jjdkr+td��n|jjdkr�|jjidd6�|jjdkr�|jjidd6�n|jjdkr�|jjidd6�q�n|j	j
r�tS|j�tS(NsAThe 'version' parameter is required when creating a new IKE peer.s
rsa-signatureRsdefault.crtR$sdefault.keyR&(
R_RZRR:RRRbR$R&RVR�Rctcreate_on_device(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRwks

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(NR}R=s+https://{0}:{1}/mgmt/tm/net/ipsec/ike-peer/RxRyRRzi�i�tmessage(i�i�(RZt
api_paramsRKR}R=R{RYR|R~tpostRR�Rtstrtcontent(R0RWR�R�R�tex((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.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(Ns.https://{0}:{1}/mgmt/tm/net/ipsec/ike-peer/{2}RxRyRRzi�R�(RZR�R{RYR|RRKR=R}R~tpatchRR�RR�R�(R0RWR�R�R�R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR��s

cC`s|j�r|j�StS(N(RvR�Rd(R0((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRk�s
cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns.https://{0}:{1}/mgmt/tm/net/ipsec/ike-peer/{2}RxRyi�(R{RYR|RRKR=R}R~tdeleteRRc(R0R�R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.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(Ns.https://{0}:{1}/mgmt/tm/net/ipsec/ike-peer/{2}RxRyRzi�R�RW(R{RYR|RRKR=R}R~RXRR�RR�R�R8(R0R�R�R�R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR��s

(R1R2RMR_RhRiRoRmRjRvRbR�RwR�R�RkR�R�(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRU�s 															
tArgumentSpeccB`seZd�ZRS(c,C`spt|_tdtdt�dtdddddd	d
g�dt�dtdddddd	d
g�d
t�dtdddg�dtdt�dt�dtdddddg�dtdddddddd d!g�d"tdd#d$d%d&d'g�d(tdd)d*d+d,d-d.d/d0d1d2d3g�d4t�d5t�d6tdd7�d8td9d:dd:d;g�d<t�d=td9d>dd?d>g�d@td9dAdBtdCgf��}i|_|jjt�|jj|�dddggdddggdd	dggdd
dggddd
ggddd
ggdd	d
ggdd
d
ggg|_d4d5gg|_dS(DNR}trequiredRtchoicestaddresstasn1dntfqdns	keyid-tags	user-fqdntoverrideR,RR*Rspre-shared-keys
rsa-signatureRtno_logRRttypetlisttv1tv2Rt3destdestblowfishtcast128taes128taes192taes256tcamelliaR tsha1tmd5tsha256tsha384tsha512R"tecp256tecp384tecp521tmodp768tmodp1024tmodp1536tmodp2048tmodp3072tmodp4096tmodp6144tmodp8192R$R&R(tboolR�tdefaultR�t	on_createR.RlRjRkR=tCommontfallbacktF5_PARTITION(	Rctsupports_check_modeR`R	t
argument_specRbRtrequired_iftrequired_together(R0R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyRM�s^								(R1R2RM(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyR��sc	C`s�t�}td|jd|jd|jd|j�}y,td|�}|j�}|j|�Wn)t	k
r�}|j
dt|��nXdS(NR�R�R�R�RVRq(R�RR�R�R�R�RURot	exit_jsonRt	fail_jsonR�(tspecRVtmmtresultsR�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pytmains				t__main__N((t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RRRt'library.module_utils.network.f5.compareRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.compareRR8R;R>RERItobjectRJRUR�R�R1(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_ike_peer.pyt<module>sN


�#D
M
�J	

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