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

�
�Udac@`sUddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZyTdd
l
mZddlmZddlmZddlmZddlmZWnaek
r)dd
lmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZ d$e fd%��YZ!d&e fd'��YZ"d(efd)��YZ#d*�Z$e%d+krQe$�nd,S(-i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_snmp_community
short_description: Manages SNMP communities on a BIG-IP.
description:
  - Assists in managing SNMP communities on a BIG-IP. Different SNMP versions are supported
    by this module. Take note of the different parameters offered by this module, as different
    parameters work for different versions of SNMP. Typically this becomes an interest if you
    are mixing versions C(v2c) and C(3).
version_added: 2.6
options:
  state:
    description:
      - When C(present), ensures that the address list and entries exists.
      - When C(absent), ensures the address list is removed.
    type: str
    choices:
      - present
      - absent
    default: present
  version:
    description:
      - Specifies to which Simple Network Management Protocol (SNMP) version the trap destination applies.
    type: str
    choices:
      - v1
      - v2c
      - v3
    default: v2c
  name:
    description:
      - Name that identifies the SNMP community.
      - When C(version) is C(v1) or C(v2c), this parameter is required.
      - The name C(public) is a reserved name on the BIG-IP. This module handles that name differently
        than others. Functionally, you should not see a difference however.
    type: str
  community:
    description:
      - Specifies the community string (password) for access to the MIB.
      - This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
        something else, this parameter is ignored.
    type: str
  source:
    description:
      - Specifies the source address for access to the MIB.
      - This parameter can accept a value of C(all).
      - If this parameter is not specified, the value C(all) is used.
      - This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
        something else, this parameter is ignored.
      - If C(source) is set to C(all), then it is not possible to specify an C(oid). This will
        raise an error.
      - This parameter should be provided when C(state) is C(absent), so that the correct community
        is removed. To remove the C(public) SNMP community that comes with a BIG-IP, this parameter
        should be set to C(default).
    type: str
  port:
    description:
      - Specifies the port for the trap destination.
      - This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
        something else, this parameter is ignored.
    type: int
  oid:
    description:
      - Specifies the object identifier (OID) for the record.
      - When C(version) is C(v3), this parameter is required.
      - When C(version) is either C(v1) or C(v2c), if this value is specified, then C(source)
        must not be set to C(all).
    type: str
  access:
    description:
      - Specifies the user's access level to the MIB.
      - When creating a new community, if this parameter is not specified, the default is C(ro).
      - When C(ro), specifies that the user can view the MIB, but cannot modify the MIB.
      - When C(rw), specifies that the user can view and modify the MIB.
    type: str
    choices:
      - ro
      - rw
      - read-only
      - read-write
  ip_version:
    description:
      - Specifies whether the record applies to IPv4 or IPv6 addresses.
      - When creating a new community, if this value is not specified, the default of C(4) will
        be used.
      - This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
        something else, this parameter is ignored.
    type: str
    choices:
      - '4'
      - '6'
  snmp_username:
    description:
      - Specifies the name of the user for whom you want to grant access to the SNMP v3 MIB.
      - This parameter is only relevant when C(version) is C(v3). If C(version) is something
        else, this parameter is ignored.
      - When creating a new SNMP C(v3) community, this parameter is required.
      - This parameter cannot be changed once it has been set.
    type: str
  snmp_auth_protocol:
    description:
      - Specifies the authentication method for the user.
      - When C(md5), specifies that the system uses the MD5 algorithm to authenticate the user.
      - When C(sha), specifies that the secure hash algorithm (SHA) to authenticate the user.
      - When C(none), specifies that user does not require authentication.
      - When creating a new SNMP C(v3) community, if this parameter is not specified, the default
        of C(sha) will be used.
    type: str
    choices:
      - md5
      - sha
      - none
  snmp_auth_password:
    description:
      - Specifies the password for the user.
      - When creating a new SNMP C(v3) community, this parameter is required.
      - This value must be at least 8 characters long.
    type: str
  snmp_privacy_protocol:
    description:
      - Specifies the encryption protocol.
      - When C(aes), specifies that the system encrypts the user information using AES
        (Advanced Encryption Standard).
      - When C(des), specifies that the system encrypts the user information using DES
        (Data Encryption Standard).
      - When C(none), specifies that the system does not encrypt the user information.
      - When creating a new SNMP C(v3) community, if this parameter is not specified, the
        default of C(aes) will be used.
    type: str
    choices:
      - aes
      - des
      - none
  snmp_privacy_password:
    description:
      - Specifies the password for the user.
      - When creating a new SNMP C(v3) community, this parameter is required.
      - This value must be at least 8 characters long.
    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 resources.
    type: str
    choices:
      - always
      - on_create
    default: always
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
ss
- name: Create an SMNP v2c read-only community
  bigip_snmp_community:
    name: foo
    version: v2c
    source: all
    oid: .1
    access: ro
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Create an SMNP v3 read-write community
  bigip_snmp_community:
    name: foo
    version: v3
    snmp_username: foo
    snmp_auth_protocol: sha
    snmp_auth_password: secret
    snmp_privacy_protocol: aes
    snmp_privacy_password: secret
    oid: .1
    access: rw
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove the default 'public' SNMP community
  bigip_snmp_community:
    name: public
    source: default
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
sD
community:
  description: The new community value.
  returned: changed
  type: str
  sample: community1
oid:
  description: The new OID value.
  returned: changed
  type: str
  sample: .1
ip_version:
  description: The new IP version value.
  returned: changed
  type: str
  sample: .1
snmp_auth_protocol:
  description: The new SNMP auth protocol.
  returned: changed
  type: str
  sample: sha
snmp_privacy_protocol:
  description: The new SNMP privacy protocol.
  returned: changed
  type: str
  sample: aes
access:
  description: The new access level for the MIB.
  returned: changed
  type: str
  sample: ro
source:
  description: The new source address to access the MIB.
  returned: changed
  type: str
  sample: 1.1.1.1
snmp_username:
  description: The new SNMP username.
  returned: changed
  type: str
  sample: user1
snmp_auth_password:
  description: The new password of the given snmp_username.
  returned: changed
  type: str
  sample: secret1
snmp_privacy_password:
  description: The new password of the given snmp_username.
  returned: changed
  type: str
  sample: secret2
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spec(ttransform_namet
ParameterscB`s�eZi	dd6dd6dd6dd6dd	6d
d6dd
6dd6dd6Zddddddddd
d	dgZdddddddd
ddg
Zddddddddddd
gZed��ZRS(t	communityt
communityNametoidt	oidSubsett
ip_versiontipv6tsnmp_auth_protocoltauthProtocoltsnmp_privacy_protocoltprivacyProtocolt
snmp_usernametusernametsecurity_levelt
securityLeveltsnmp_auth_passwordtauthPasswordtsnmp_privacy_passwordtprivacyPasswordtsourcetaccesscC`s(|jddkrdSt|jd�S(Ntport(t_valuestNonetint(tself((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR$Us(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyR$(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRsV
			t
ApiParameterscB`s&eZed��Zed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NRtenabledii(R%R&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR]s
cC`s"|jddkrdS|jdS(NR"tall(R%R&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR"es(R)R*R/RR"(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR0\stModuleParameterscB`sbeZed��Zed��Zed��Zed��Zed��Zed��ZRS(cC`s(|jddkrdSt|jd�S(NR(R%R&R'(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRmscC`s9|jddkrdS|jddkr.dS|jdS(NR"tR2(R%R&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR"ss
cC`se|jddkrdS|jddkr.dS|jddkrEdStdj|jd���dS(	NR#tros	read-onlytrws
read-writes'Unknown access format specified: '{0}'.(R5s	read-only(R6s
read-write(R%R&Rtformat(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR#{scC`sJ|jddkrdSt|jd�dkr?td��n|jdS(NRis6snmp_auth_password must be at least 8 characters long.(R%R&tlenR(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�scC`sJ|jddkrdSt|jd�dkr?td��n|jdS(NR is9snmp_privacy_password must be at least 8 characters long.(R%R&R8R(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR �scC`s"|jddkrdS|jdS(Ntnametpublicscomm-public(R%(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR9�s(	R)R*R/RR"R#RR R9(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR3ls


tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R-tgetattrt_filter_paramst	Exception(R(tresultt
returnable((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt	to_return�s
(R)R*RA(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR;�st
UsableChangescB`s&eZed��Zed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NRitdisabledR1(R%R&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�s
cC`s9|jddkrdS|jddkr.dS|jdS(NR"R2R4(R%R&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR"�s
(R)R*R/RR"(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRB�stReportableChangescB`seZRS((R)R*(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRD�st
DifferencecB`skeZdd�Zd�Zd�Zd�Zed��Zed��Z	ed��Z
ed��ZRS(	cC`s||_||_dS(N(twantthave(R(RFRG((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R<tAttributeErrort_Difference__default(R(tparamR?((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R<RFRGRI(R(RKtattr1tattr2((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt	__default�s
cC`s|jjdk	rH|jjdkrH|jjdkrHtd��qHn|jjdkr{|jjdkr{td��ndS(NR2R4shWhen specifying an 'all' source for a resource with an existing OID, you must specify a new, empty, OID.sKWhen specifying an 'all' source for a resource, you may not specify an OID.(RGRR&RFR"R(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt_check_source_and_oid�s$$cC`s0|j�|jj|jjkr,|jjSdS(N(RPRFR"RG(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR"�s
cC`s0|j�|jj|jjkr,|jjSdS(N(RPRFRRG(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�s
cC`s2|jjdkr.|jjdk	r.|jjSdS(Ntalways(RFtupdate_passwordR R&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR �s$cC`s2|jjdkr.|jjdk	r.|jjSdS(NRQ(RFRRRR&(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�s$N(R)R*R&RHRLRJRPR/R"RR R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRE�s				t
ModuleManagercB`s,eZd�Zd�Zd�Zd�ZRS(cO`s7||_|jdd�|_|jdd�|_dS(Ntclienttmodule(tkwargstgetR&RTRU(R(targsRV((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRH�s	cC`s7|j�r|jd�}n|jd�}|j�S(Ntv1tv2(tversion_is_less_than_3tget_managertexec_module(R(tmanager((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR]scC`s6|dkrt|j�S|dkr2t|j�SdS(NRYRZ(t	V1ManagerRVt	V2Manager(R(ttype((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR\	s
cC`s-|jjjd�}|dkr%tStSdS(Ntversiontv3(RUtparamsRWtFalsetTrue(R(Rb((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR[s(R)R*RHR]R\R[(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRS�s			tBaseManagercB`sbeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(NRURd(RWR&RUR
RdRTR3RFR0RGRBtchanges(R(RXRV((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRHs
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRd(RR-R<RFR&RBRh(R(tchangedtkey((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt_set_changed_optionss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(NRd(RERFRGRR.tdictRLR&t
isinstancetupdateRBRhRfRe(R(tdiffR.Ritktchange((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt_update_changed_options's		
cC`s|j�}|rtStS(N(RrRfRe(R(R?((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt
should_update9scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRdRi(ReRlRFtstateRtRuRDRhRARnt_announce_deprecations(R(RiR?Rvt
reportableRh((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR]?s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgRb(tpopRTRUt	deprecate(R(R?twarningstwarning((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRwPs


cC`s$|j�r|j�S|j�SdS(N(texistsRntcreate(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRtXs
cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRGRsReRUt
check_modeRftupdate_on_device(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRn^s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RUR�Rftremove_from_deviceRR(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pytremovegs
cC`s|j�r|j�StS(N(RR�Re(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRuos
(R)R*RHRkRrRsR]RwRtRnR�Ru(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRgs										R_cB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(sHandles SNMP v1 and v2c

    cC`s�|jjdkr,|jjidd6�n|jjdkrX|jjidd6�n|j�|jjdk	r�|jjdkr�td��n|j	j
r�tS|j�tS(NiRR5R#R2s4When specify an oid, source may not be set to 'all'.(
RFRR&RnR#RkRR"RRUR�Rftcreate_on_device(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�ys
$
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns0https://{0}:{1}/mgmt/tm/sys/snmp/communities/{2}tservertserver_porti�tcode(R7RTtproviderRRFt	partitionR9tapiRWtjsont
ValueErrorReRRf(R(turitresptresponse((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�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(NR9R�s-https://{0}:{1}/mgmt/tm/sys/snmp/communities/R�R�R�R�i�i�tmessage(i�i�(Rht
api_paramsRFR9R�R7RTR�R�tpostR�R�Rtstrtcontent(R(RdR�R�R�tex((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.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(Ns0https://{0}:{1}/mgmt/tm/sys/snmp/communities/{2}R�R�R�R�i�R�(RhR�R7RTR�RRFR�R9R�tpatchR�R�RR�R�(R(RdR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR��s

cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns0https://{0}:{1}/mgmt/tm/sys/snmp/communities/{2}R�R�i�(R7RTR�RRFR�R9R�tdeleteRRf(R(R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.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(Ns0https://{0}:{1}/mgmt/tm/sys/snmp/communities/{2}R�R�R�i�R�Rd(R7RTR�RRFR�R9R�RWR�R�RR�R�R0(R(R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR��s

(	R)R*t__doc__R�RR�R�R�R�(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR_us					
R`cB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s�Handles SNMP v3

    SNMP v3 has (almost) a completely separate set of variables than v2c or v1.
    The functionality is placed in this separate class to handle these differences.

    cC`s0|jjdkr,|jjidd6�n|jjdkrX|jjidd6�n|jjdkr�|jjidd6�n|j�|jjdkr�td��n|jj	dkr�td��n|jj
dkr�td	��n|jjdkrtd
��n|jj
r"tS|j�tS(NR5R#tshaRtaesRsAsnmp_username must be specified when creating a new v3 community.sFsnmp_auth_password must be specified when creating a new v3 community.sIsnmp_privacy_password must be specified when creating a new v3 community.s7oid must be specified when creating a new v3 community.(RFR#R&RnRRRkRRRR RRUR�RfR�(R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR��s.

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/sys/snmp/users/{2}R�R�i�R�(R7RTR�RRFR�RR�RWR�R�ReRRf(R(R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRs


+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(NR9R�s'https://{0}:{1}/mgmt/tm/sys/snmp/users/R�R�R�R�i�i�R�(i�i�(RhR�RFRR�R7RTR�R�R�R�R�RR�R�(R(RdR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.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/sys/snmp/users/{2}R�R�R�R�i�R�(RhR�R7RTR�RRFR�RR�R�R�R�RR�R�(R(RdR�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�$s

cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns*https://{0}:{1}/mgmt/tm/sys/snmp/users/{2}R�R�i�(R7RTR�RRFR�RR�R�RRf(R(R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�7s

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/sys/snmp/users/{2}R�R�R�i�R�Rd(R7RTR�RRFR�RR�RWR�R�RR�R�R0(R(R�R�R�R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�As

(	R)R*R�R�RR�R�R�R�(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR`�s					
tArgumentSpeccB`seZd�ZRS(c&C`s�t|_tdtddddddg�dt�dt�d	t�d
tdd�d
t�dtdddddg�dtdddg�dt�dtddddg�dtdt�dtddddg�d tdt�d!tdd"dd"d#g�d$tdd%dd&d%g�d'tdd(d)td*gf��}i|_|jjt�|jj|�dddggdd+dggdddggg|_dS(,NRbtdefaulttv2ctchoicesRYRcR9RR"R$RaR'RR#R5R6s	read-onlys
read-writeRt4t6RRtmd5R�tnoneRtno_logRR�tdesR RRRQt	on_createRvRtRuR�tCommontfallbacktF5_PARTITIONRZ(Rftsupports_check_modeRlR	t
argument_specRnR
trequired_if(R(R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyRHVsD							(R)R*RH(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyR�UscC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�RURz(R�RR�R�R�RSR]t	exit_jsonRt	fail_jsonR�(tspecRUtmmtresultsR�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pytmain�s			t__main__N(&t
__future__RRRRat
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR0R3R;RBRDtobjectRERSRgR_R`R�R�R)(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp_community.pyt<module>sH


�+5
=77^gy0	

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