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

�
�Udac@`sSddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZytdd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
ridd
lmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZ d"efd#��YZ!d$efd%��YZ"d&�Z#e$d'krOe#�nd(S()i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_profile_server_ssl
short_description: Manages server SSL profiles on a BIG-IP
description:
  - Manages server SSL profiles on a BIG-IP.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the profile.
    type: str
    required: True
  parent:
    description:
      - The parent template of this monitor template. Once this value has
        been set, it cannot be changed.
    type: str
    default: /Common/serverssl
  ciphers:
    description:
      - Specifies the list of ciphers that the system supports. When creating a new
        profile, the default cipher list is provided by the parent profile.
    type: str
  secure_renegotiation:
    description:
      - Specifies the method of secure renegotiations for SSL connections. When
        creating a new profile, the setting is provided by the parent profile.
      - When C(request) is set the system request secure renegotation of SSL
        connections.
      - C(require) is a default setting and when set the system permits initial SSL
        handshakes from clients but terminates renegotiations from unpatched clients.
      - The C(require-strict) setting the system requires strict renegotiation of SSL
        connections. In this mode the system refuses connections to insecure servers,
        and terminates existing SSL connections to insecure servers.
    type: str
    choices:
      - require
      - require-strict
      - request
  server_name:
    description:
      - Specifies the fully qualified DNS hostname of the server used in Server Name
        Indication communications. When creating a new profile, the setting is provided
        by the parent profile.
    type: str
  sni_default:
    description:
      - Indicates that the system uses this profile as the default SSL profile when there
        is no match to the server name, or when the client provides no SNI extension support.
      - When creating a new profile, the setting is provided by the parent profile.
      - There can be only one SSL profile with this setting enabled.
    type: bool
  sni_require:
    description:
      - Requires that the network peers also provide SNI support, setting only takes
        effect when C(sni_default) is C(yes).
      - When creating a new profile, the setting is provided by the parent profile.
    type: bool
  server_certificate:
    description:
      - Specifies the way the system handles server certificates.
      - When C(ignore), specifies that the system ignores certificates from server systems.
      - When C(require), specifies that the system requires a server to present a valid
        certificate.
    type: str
    choices:
      - ignore
      - require
  certificate:
    description:
      - Specifies the name of the certificate that the system uses for server-side SSL
        processing.
    type: str
  key:
    description:
      - Specifies the file name of the SSL key.
    type: str
  chain:
    description:
      - Specifies the certificates-key chain to associate with the SSL profile.
    type: str
  passphrase:
    description:
      - Specifies a passphrase used to encrypt the key.
    type: str
  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 profiles.
    type: str
    choices:
      - always
      - on_create
    default: always
  ocsp_profile:
    description:
      - Specifies the name of the OCSP profile for purpose of validating status
        of server certificate.
    type: str
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the profile exists.
      - When C(absent), ensures the profile is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s�
- name: Create a new server SSL profile
  bigip_profile_server_ssl:
    name: foo
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s$
ciphers:
  description: The ciphers applied to the profile.
  returned: changed
  type: str
  sample: "!SSLv3:!SSLv2:ECDHE+AES-GCM+SHA256:ECDHE-RSA-AES128-CBC-SHA"
secure_renegotiation:
  description: The method of secure SSL renegotiation.
  returned: changed
  type: str
  sample: request
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(tflatten_boolean(ttransform_namet
ParameterscB`seZidd6dd6dd6dd6dd	6d
d6dd
6dd6Zdddddddd	dd
dgZddddddddd
ddgZdddddddd
ddg
Zed��Zed��Zed��Z	ed��Z
ed��ZRS(tcertificatetcerttocsp_profiletocsptparenttdefaultsFromtsecure_renegotiationtsecureRenegotiationtsni_defaultt
sniDefaulttsni_requiret
sniRequiretserver_namet
serverNametserver_certificatetpeerCertModetchaintcipherstkeycC`st|jd�S(NR(Rt_values(tself((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�scC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NRttnone(R'R((R%tNoneR
t	partition(R&tresult((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�scC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NR$R'R((R'snone(R%R)R
R*(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR$�scC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NR"R'R((R'snone(R%R)R
R*(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR"�scC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NRR'R((R'snone(R%R)R
R*(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRs(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRRR$R"R(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�s\
						t
ApiParameterscB`s&eZed��Zed��ZRS(cC`st|jd�S(NR(RR%(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRscC`s"|jddkrdS|jdS(NRR((Nsnone(R%R)(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRs(R,R-R2RR(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR3stModuleParameterscB`s5eZed��Zed��Zed��ZRS(cC`s9|jddkrdS|jddkr.dS|jdS(NRR'R((R'snone(R%R)(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRs
cC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NRt	serverssls/Common/serverssl(R%R)R
R*(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR&scC`sft|jd�}|j}|dkr,dS|dkrb|dkrbtdj||���qbn|S(NRtnotyess>Cannot set 'sni_require' to {0} if 'sni_default' is set as {1}(NR6(RR%RR)Rtformat(R&trequiretdefault((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR/s	(R,R-R2RRR(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR4s	tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R0tgetattrt_filter_paramst	Exception(R&R+t
returnable((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyt	to_return=s
(R,R-R@(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR;<st
UsableChangescB`s&eZed��Zed��ZRS(cC`s6|jddkrdS|jddkr.dSdSdS(NRR7ttruetfalse(R%R)(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRIs
cC`s6|jddkrdS|jddkr.dSdSdS(NRR7RBRC(R%R)(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRRs
(R,R-R2RR(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRAHs	tReportableChangescB`s&eZed��Zed��ZRS(cC`st|jd�}|S(NR(RR%(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR]scC`st|jd�}|S(NR(RR%(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRbs(R,R-R2RR(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRD\st
DifferencecB`sSeZdd�Zd�Zed��Zed��Zed��Zd�Z	RS(cC`s||_||_dS(N(twantthave(R&RFRG((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyt__init__is	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R<tAttributeErrort_Difference__default(R&tparamR+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pytcomparems

cC`s+|jj|jjkr'td��ndS(Ns$The parent profile cannot be changed(RFRRGR(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRtscC`s�|jjdkrdS|jjdkrv|jjdkrv|jjdkrvtdj|jj|jj���qvn|jj|jjkr�|jjSdS(NR6R7s7Cannot set 'sni_require' to {0} if 'sni_default' is {1}(RFRR)RGRRR8(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR{s$!cC`sd|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkr`|jjSdS(NR'(RFRR)RG(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�s$cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R<RFRGRI(R&RKtattr1tattr2((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyt	__default�s
N(
R,R-R)RHRLR2RRRRJ(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyREhs		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)RQR
RRtclientR4RFR3RGRAtchanges(R&targstkwargs((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRH�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRR(RR0R<RFR)RARU(R&tchangedR$((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.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(NRR(RERFRGRR1tdictRLR)t
isinstancetupdateRARUtTruetFalse(R&tdiffR1RXtktchange((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RbR]R^(R&R+((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRRRX(R^RZRFtstateRdReRDRUR@R\t_announce_deprecations(R&RXR+Rft
reportableRU((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRTRQt	deprecate(R&R+twarningstwarning((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRg�s


cC`s$|j�r|j�S|j�SdS(N(texistsR\tcreate(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRd�s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns2https://{0}:{1}/mgmt/tm/ltm/profile/server-ssl/{2}tservertserver_porti�tcode(R8RTtproviderRRFR*tnametapiRStjsont
ValueErrorR^RR](R&turitresptresponse((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRq�s


+cC`s�|j�|_|jjdkrA|jji|jjd6�n|jjr]|jjd=n|j�smtS|j	j
r}tS|j�tS(Ntalwayst
passphrase(
tread_current_from_deviceRGRFtupdate_passwordR\RR%RcR^RQt
check_modeR]tupdate_on_device(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR\�s 
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RQR�R]tremove_from_deviceRqR(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pytremoves
cC`s(|j�|jjrtS|j�tS(N(RYRQR�R]tcreate_on_device(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRrs


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��ndS(
NRwR*s/https://{0}:{1}/mgmt/tm/ltm/profile/server-ssl/RsRtRyRui�i�i�tmessage(i�i�i�(RUt
api_paramsRFRwR*R8RTRvRxtpostRyRzRtstrtcontent(R&RRR{R|R}tex((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�s
cC`s�|jj�}dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|dd	kr�d|kr�t
|d��q�t
|j��ndS(
Ns2https://{0}:{1}/mgmt/tm/ltm/profile/server-ssl/{2}RsRtRyRui�i�R�(i�i�(RUR�R8RTRvRRFR*RwRxtpatchRyRzRR�R�(R&RRR{R|R}R�((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�&s

cC`s|j�r|j�StS(N(RqR�R^(R&((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRe9s
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns2https://{0}:{1}/mgmt/tm/ltm/profile/server-ssl/{2}RsRti�(
R8RTRvRRFR*RwRxtdeleteRR]RR�(R&R{R}((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.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(Ns2https://{0}:{1}/mgmt/tm/ltm/profile/server-ssl/{2}RsRtRui�R�RR(R8RTRvRRFR*RwRxRSRyRzRR�R�R3(R&R{R|R}R�((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�Is

(R,R-RHRYRbRcRiRgRdRqR\R�RrR�R�ReR�R�(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRP�s 															tArgumentSpeccB`seZd�ZRS(c&C`sSt|_tdtdt�dt�dt�dt�dtdt�dtd	d
�dt�dtd
dddg�dtd
ddg�dtd	dd
ddg�dtd	dd
ddg�dtdd�dtdd�dt�dt�dtd	d d!td"gf��}i|_|jjt�|jj|�ddgg|_dS(#NRwtrequiredRR"R$Rtno_logRR:s/Common/serversslR#RtchoicesR9srequire-stricttrequestR tignoreRfRdReR�R~t	on_createRttypetboolRRRR*tCommontfallbacktF5_PARTITION(R]tsupports_check_modeRZR	t
argument_specR\Rtrequired_together(R&R�((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyRH^s<								(R,R-RH(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyR�]scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�RQRk(R�RR�R�R�RPRit	exit_jsonRt	fail_jsonR�(tspecRQtmmtresultsR�((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pytmain�s			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
RRRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR3R4R;RARDtobjectRERPR�R�R,(((sW/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_server_ssl.pyt<module>sJ


w

^4�*	

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