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

�
�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_dns_resolver
short_description: Manage DNS resolvers on a BIG-IP
description:
  - Manage DNS resolver on a BIG-IP.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the DNS resolver.
    type: str
    required: True
  route_domain:
    description:
      - Specifies the route domain the resolver uses for outbound traffic.
    type: int
  cache_size:
    description:
      - Specifies the size of the internal DNS resolver cache.
      - When creating a new resolver, if this parameter is not specified, the default
        is 5767168 bytes.
      - After the cache reaches this size, when new or refreshed content arrives, the
        system removes expired and older content and caches the new or updated content.
    type: int
  answer_default_zones:
    description:
      - Specifies whether the system answers DNS queries for the default zones localhost,
        reverse 127.0.0.1 and ::1, and AS112.
      - When creating a new resolver, if this parameter is not specified, the default
        is C(no), meaning that the system passes along the DNS queries for the default zones.
    type: bool
  randomize_query_case:
    description:
      - When C(yes), specifies that the internal DNS resolver randomizes character case
        in domain name queries issued to the root DNS servers.
      - When creating a new resolver, if this parameter is not specified, the default
        is C(yes).
    type: bool
  use_ipv4:
    description:
      - Specifies whether the system can use IPv4 to query backend nameservers.
      - An IPv4 Self IP and default route must be available for these queries to work
        successfully.
      - When creating a new resolver, if this parameter is not specified, the default
        is C(yes).
    type: bool
  use_ipv6:
    description:
      - Specifies whether the system can use IPv6 to query backend nameservers.
      - An IPv6 Self IP and default route must be available for these queries to work
        successfully.
      - When creating a new resolver, if this parameter is not specified, the default
        is C(yes).
    type: bool
  use_udp:
    description:
      - Specifies whether the system answers and issues UDP-formatted queries.
      - When creating a new resolver, if this parameter is not specified, the default
        is C(yes).
    type: bool
  use_tcp:
    description:
      - Specifies whether the system answers and issues TCP-formatted queries.
      - When creating a new resolver, if this parameter is not specified, the default
        is C(yes).
    type: bool
  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
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s�
- name: Create a simple DNS responder for OCSP stapling
  bigip_dns_resolver:
    name: resolver1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
sf
route_domain:
  description: The new route domain of the resource.
  returned: changed
  type: str
  sample: /Common/0
cache_size:
  description: The new cache size of the resource.
  returned: changed
  type: int
  sample: 50000
answer_default_zones:
  description: The new Answer Default Zones setting.
  returned: changed
  type: bool
  sample: yes
randomize_query_case:
  description: The new Randomize Query Character Case setting.
  returned: changed
  type: bool
  sample: no
use_ipv4:
  description: The new Use IPv4 setting.
  returned: changed
  type: bool
  sample: yes
use_ipv6:
  description: The new Use IPv6 setting.
  returned: changed
  type: bool
  sample: no
use_udp:
  description: The new Use UDP setting.
  returned: changed
  type: bool
  sample: yes
use_tcp:
  description: The new Use TCP setting.
  returned: changed
  type: bool
  sample: no
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tflatten_booleant
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6dd
6dd6Zddddd	dd
dgZdddddd
ddgZdddddd
ddgZed��Zed��Zed��Z	ed��Z
ed��Zed��ZRS(tanswer_default_zonestanswerDefaultZonest
cache_sizet	cacheSizetrandomize_query_casetrandomizeQueryNameCasetroute_domaintrouteDomaintuse_ipv4tuseIpv4tuse_ipv6tuseIpv6tuse_tcptuseTcptuse_udptuseUdpcC`st|jd�}|S(NR(Rt_values(tselftresult((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR�scC`st|jd�}|S(NR(RR"(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR�scC`st|jd�}|S(NR(RR"(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR�scC`st|jd�}|S(NR(RR"(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR�scC`st|jd�}|S(NR(RR"(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR�scC`st|jd�}|S(NR (RR"(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR �s(
t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRRRRRR (((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR�sN
			t
ApiParameterscB`seZRS((R%R&(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR,�stModuleParameterscB`seZed��ZRS(cC`s4|jddkrdSt|j|jd�}|S(NR(R"tNoneR
t	partition(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRs(R%R&R+R(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR-stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R)tgetattrt_filter_paramst	Exception(R#R$t
returnable((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyt	to_return
s
(R%R&R5(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR0	st
UsableChangescB`seZRS((R%R&(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR6stReportableChangescB`seZRS((R%R&(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR7st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(R#R9R:((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyt__init__s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R1tAttributeErrort_Difference__default(R#tparamR$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pytcompare"s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R1R9R:R<(R#R>tattr1tattr2((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyt	__default)s
N(R%R&R.R;R?R=(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR8s	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.RDR
REtclientR-R9R,R:R6tchanges(R#targstkwargs((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR;4s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRE(RR)R1R9R.R6RH(R#tchangedtkey((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.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(NRE(R8R9R:RR*tdictR?R.t
isinstancetupdateR6RHtTruetFalse(R#tdiffR*RKtktchange((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyt_update_changed_optionsCs		
cC`s|j�}|rtStS(N(RVRQRR(R#R$((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyt
should_updateUscC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRERK(RRRNR9tstateRXRYR7RHR5RPt_announce_deprecations(R#RKR$RZt
reportableRH((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pytexec_module[s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRGRDt	deprecate(R#R$twarningstwarning((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR[ls


cC`s$|j�r|j�S|j�SdS(N(texistsRPtcreate(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRXts
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/dns-resolver/{2}tservertserver_porti�tcode(tformatRGtproviderRR9R/tnametapiRFtjsont
ValueErrorRRRRQ(R#turitresptresponse((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRezs


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR:RWRRRDt
check_modeRQtupdate_on_device(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRP�s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RDRtRQtremove_from_deviceReR(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pytremove�s
cC`s(|j�|jjrtS|j�tS(N(RMRDRtRQtcreate_on_device(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRf�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(NRlR/s)https://{0}:{1}/mgmt/tm/net/dns-resolver/RgRhRnRii�i�tmessage(i�i�(RHt
api_paramsR9RlR/RjRGRkRmtpostRnRoRtstrtcontent(R#RERpRqRrtex((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRx�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/dns-resolver/{2}RgRhRnRii�Ry(RHRzRjRGRkRR9R/RlRmtpatchRnRoRR|R}(R#RERpRqRrR~((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRu�s

cC`s|j�r|j�StS(N(ReRwRR(R#((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRY�s
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns,https://{0}:{1}/mgmt/tm/net/dns-resolver/{2}RgRhi�(
RjRGRkRR9R/RlRmtdeleteRRQRR}(R#RpRr((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRv�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/dns-resolver/{2}RgRhRii�RyRE(RjRGRkRR9R/RlRmRFRnRoRR|R}R,(R#RpRqRrR~((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRs�s

(R%R&R;RMRVRWR]R[RXReRPRwRfRxRuRYRvRs(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyRC3s 																tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dtdd�dtdd�dtdd�d	tdd�d
tdd�dtdd�dtdd�d
tdd�dtdddddg�dtdddtdgf��}i|_|jjt�|jj|�dS(NRltrequiredRttypetintRRtboolRRRR RRZtdefaultRXtchoicesRYR/tCommontfallbacktF5_PARTITION(RQtsupports_check_modeRNR	t
argument_specRPR(R#R�((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR;�s(		(R%R&R;(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RDR_(
R�RR�R�RCR]t	exit_jsonRt	fail_jsonR|(tspecRDtmmtresultsR~((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.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
RRRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR,R-R0R6R7tobjectR8RCR�R�R%(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_resolver.pyt<module>sJ


V+
L	�	

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