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

�
�Udac@`s3ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZyddd
l
mZddlmZddlmZddlmZddlmZddlmZWnqek
rIdd
lmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!efd"��YZ d#efd$��YZ!d%�Z"e#d&kr/e"�nd'S((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_profile_dns
short_description: Manage DNS profiles on a BIG-IP
description:
  - Manage DNS profiles on a BIG-IP. Many DNS profiles; each with their
    own adjustments to the standard C(dns) profile. Users of this module should be aware
    that many of the adjustable knobs have no module default. Instead, the default is
    assigned by the BIG-IP system itself which, in most cases, is acceptable.
version_added: 2.6
options:
  name:
    description:
      - Specifies the name of the DNS profile.
    type: str
    required: True
  parent:
    description:
      - Specifies the profile from which this profile inherits settings.
      - When creating a new profile, if this parameter is not specified, the default
        is the system-supplied C(dns) profile.
    type: str
  enable_dns_express:
    description:
      - Specifies whether the DNS Express engine is enabled.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
      - The DNS Express engine receives zone transfers from the authoritative DNS server
        for the zone. If the C(enable_zone_transfer) setting is also C(yes) on this profile,
        the DNS Express engine also responds to zone transfer requests made by the nameservers
        configured as zone transfer clients for the DNS Express zone.
    type: bool
  enable_zone_transfer:
    description:
      - Specifies whether the system answers zone transfer requests for a DNS zone created
        on the system.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
      - The C(enable_dns_express) and C(enable_zone_transfer) settings on a DNS profile
        affect how the system responds to zone transfer requests.
      - When the C(enable_dns_express) and C(enable_zone_transfer) settings are both C(yes),
        if a zone transfer request matches a DNS Express zone, then DNS Express answers the
        request.
      - When the C(enable_dns_express) setting is C(no) and the C(enable_zone_transfer)
        setting is C(yes), the BIG-IP system processes zone transfer requests based on the
        last action and answers the request from local BIND or a pool member.
    type: bool
  enable_dnssec:
    description:
      - Specifies whether the system signs responses with DNSSEC keys and replies to DNSSEC
        specific queries (e.g., DNSKEY query type).
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
    type: bool
  enable_gtm:
    description:
      - Specifies whether the system uses Global Traffic Manager to manage the response.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
    type: bool
  process_recursion_desired:
    description:
      - Specifies whether to process client-side DNS packets with Recursion Desired set in
        the header.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
      - If set to C(no), processing of the packet is subject to the unhandled-query-action
        option.
    type: bool
  use_local_bind:
    description:
      - Specifies whether the system forwards non-wide IP queries to the local BIND server
        on the BIG-IP system.
      - For best performance, disable this setting when using a DNS cache.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
    type: bool
  enable_dns_firewall:
    description:
      - Specifies whether DNS firewall capability is enabled.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
    type: bool
  enable_cache:
    description:
      - Specifies whether the system caches DNS responses.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
      - When C(yes), the BIG-IP system caches DNS responses handled by the virtual
        servers associated with this profile. When you enable this setting, you must
        also specify a value for C(cache_name).
      - When C(no), the BIG-IP system does not cache DNS responses handled by the
        virtual servers associated with this profile. However, the profile retains
        the association with the DNS cache in the C(cache_name) parameter. Disable
        this setting when you want to debug the system.
    type: bool
    version_added: 2.7
  cache_name:
    description:
      - Specifies the user-created cache that the system uses to cache DNS responses.
      - When you select a cache for the system to use, you must also set C(enable_dns_cache)
        to C(yes)
    type: str
    version_added: 2.7
  unhandled_query_action:
    description:
      - Specifies the action to take when a query does not match a Wide IP or a DNS Express Zone.
      - When C(allow), the BIG-IP system forwards queries to a DNS server or pool member.
        If a pool is not associated with a listener and the Use BIND Server on BIG-IP setting
        is set to Enabled, requests are forwarded to the local BIND server.
      - When C(drop), the BIG-IP system does not respond to the query.
      - When C(reject), the BIG-IP system returns the query with the REFUSED return code.
      - When C(hint), the BIG-IP system returns the query with a list of root name servers.
      - When C(no-error), the BIG-IP system returns the query with the NOERROR return code.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
    type: str
    choices:
      - allow
      - drop
      - reject
      - hint
      - no-error
    version_added: 2.7
  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)
sI
- name: Create a DNS profile
  bigip_profile_dns:
    name: foo
    enable_dns_express: no
    enable_dnssec: no
    enable_gtm: no
    process_recursion_desired: no
    use_local_bind: no
    enable_dns_firewall: yes
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s0
enable_dns_express:
  description: Whether DNS Express is enabled on the resource or not.
  returned: changed
  type: bool
  sample: yes
enable_zone_transfer:
  description: Whether zone transfer are enabled on the resource or not.
  returned: changed
  type: bool
  sample: no
enable_dnssec:
  description: Whether DNSSEC is enabled on the resource or not.
  returned: changed
  type: bool
  sample: no
enable_gtm:
  description: Whether GTM is used to manage the resource or not.
  returned: changed
  type: bool
  sample: yes
process_recursion_desired:
  description: Whether client-side DNS packets are processed with Recursion Desired set.
  returned: changed
  type: bool
  sample: yes
use_local_bind:
  description: Whether non-wide IP queries are forwarded to the local BIND server or not.
  returned: changed
  type: bool
  sample: no
enable_dns_firewall:
  description: Whether DNS firewall capability is enabled or not.
  returned: changed
  type: bool
  sample: no
enable_cache:
  description: Whether DNS caching is enabled or not.
  returned: changed
  type: bool
  sample: no
cache_name:
  description: Name of the cache used by DNS.
  returned: changed
  type: str
  sample: /Common/cache1
unhandled_query_action:
  description: What to do with unhandled queries
  returned: changed
  type: str
  sample: allow
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_namet
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6Zddddd	dd
ddddgZdddddd
ddddg
Zdddddd
ddddg
ZRS(tenable_dns_firewalltenableDnsFirewalltuse_local_bindtuseLocalBindtprocess_recursion_desiredt	processRdt
enable_gtmt	enableGtmt
enable_dnssectenableDnssectenable_zone_transfert
processXfrtenable_dns_expresstenableDnsExpresstparenttdefaultsFromtenable_cachetenableCachet
cache_nametcachetunhandled_query_actiontunhandledQueryAction(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�sV
		t
ApiParameterscB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��ZRS(	cC`s2|jddkrdS|jddkr.tStS(NRtyes(t_valuestNonetTruetFalse(tself((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR0s
cC`s2|jddkrdS|jddkr.tStS(NRR.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR8s
cC`s2|jddkrdS|jddkr.tStS(NRR.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR@s
cC`s2|jddkrdS|jddkr.tStS(NRR.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRHs
cC`s2|jddkrdS|jddkr.tStS(NR!R.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR!Ps
cC`s2|jddkrdS|jddkr.tStS(NRR.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRXs
cC`s2|jddkrdS|jddkr.tStS(NRR.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR`s
cC`s2|jddkrdS|jddkr.tStS(NRR.(R/R0R1R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRhs
cC`s9|jddkrdS|jddkr.dS|jdS(NR%tnoerrorsno-error(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR%ps
(R'R(tpropertyRRRRR!RRRR%(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR-/stModuleParameterscB`s&eZed��Zed��ZRS(cC`s4|jddkrdSt|j|jd�}|S(NR(R/R0R
t	partition(R3tresult((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRzscC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NR#t(R/R0R
R7(R3R8((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR#�s(R'R(R5RR#(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR6ystChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R+tgetattrt_filter_paramst	Exception(R3R8t
returnable((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyt	to_return�s
(R'R(R?(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR:�st
UsableChangescB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��ZRS(	cC`s,|jddkrdS|jdr(dSdS(NRR.tno(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s,|jddkrdS|jdr(dSdS(NRR.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s,|jddkrdS|jdr(dSdS(NRR.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s,|jddkrdS|jdr(dSdS(NRR.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s,|jddkrdS|jdr(dSdS(NR!R.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR!�s

cC`s,|jddkrdS|jdr(dSdS(NRR.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s,|jddkrdS|jdr(dSdS(NRR.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s,|jddkrdS|jdr(dSdS(NRR.RA(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�s

cC`s9|jddkrdS|jddkr.dS|jdS(NR%sno-errorR4(R/R0(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR%�s
(R'R(R5RRRRR!RRRR%(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR@�stReportableChangescB`seZRS((R'R((((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRB�st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(R3RDRE((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R;tAttributeErrort_Difference__default(R3tparamR8((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R;RDRERG(R3RItattr1tattr2((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyt	__default�s
N(R'R(R0RFRJRH(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRC�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(tgetR0ROR
RPtclientR6RDR-RER@tchanges(R3targstkwargs((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRF�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRP(RR+R;RDR0R@RS(R3tchangedtkey((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.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(NRP(RCRDRERR,tdictRJR0t
isinstancetupdateR@RSR1R2(R3tdiffR,RVtktchange((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyt_update_changed_optionss		
cC`s|j�}|rtStS(N(R_R1R2(R3R8((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyt
should_updatescC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRPRV(R2RYRDtstateRaRbRBRSR?R[t_announce_deprecations(R3RVR8Rct
reportableRS((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pytexec_module#s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRRROt	deprecate(R3R8twarningstwarning((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRd4s


cC`s$|j�r|j�S|j�SdS(N(texistsR[tcreate(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRa<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/ltm/profile/dns/{2}tservertserver_porti�tcode(tformatRRtproviderRRDR7tnametapiRQtjsont
ValueErrorR2RR1(R3turitresptresponse((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRnBs


+cC`s�|j�|_|j�stS|jjtksC|jjtkrt|jjsb|jjdkrttd��qtn|j	j
r�tS|j�tS(NR9s3To enable DNS cache, a DNS cache must be specified.(tread_current_from_deviceRER`R2RSR!R1R#RROt
check_modetupdate_on_device(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR[Qs$
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(ROR}R1tremove_from_deviceRnR(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pytremove_s
cC`sV|j�|jjtkr8|jjr8td��n|jjrHtS|j�tS(Ns^You must specify a 'cache_name' when creating a DNS profile that sets 'enable_cache' to 'yes'.(	RXRDR!R1R#RROR}tcreate_on_device(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRogs

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(
NRuR7s(https://{0}:{1}/mgmt/tm/ltm/profile/dns/RpRqRwRri�i�i�tmessage(i�i�i�(RSt
api_paramsRDRuR7RsRRRtRvtpostRwRxRtstrtcontent(R3RPRyRzR{tex((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR�ss
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(
Ns+https://{0}:{1}/mgmt/tm/ltm/profile/dns/{2}RpRqRwRri�i�R�(i�i�(RSR�RsRRRtRRDR7RuRvtpatchRwRxRR�R�(R3RPRyRzR{R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR~�s

cC`s|j�r|j�StS(N(RnR�R2(R3((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRb�s
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns+https://{0}:{1}/mgmt/tm/ltm/profile/dns/{2}RpRqi�(
RsRRRtRRDR7RuRvtdeleteRR1RR�(R3RyR{((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.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/ltm/profile/dns/{2}RpRqRri�R�RP(RsRRRtRRDR7RuRvRQRwRxRR�R�R-(R3RyRzR{R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR|�s

(R'R(RFRXR_R`RfRdRaRnR[R�RoR�R~RbRR|(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRN�s 															tArgumentSpeccB`seZd�ZRS(c"C`s/t|_tdtdt�dt�dtdd�dtdd�dtdd�d	tdd�d
tdd�dtdd�dtdd�d
tdd�dtddddddg�dt�dtdddddg�dtdddtdgf��}i|_|jjt�|jj|�dS(NRutrequiredRRttypetboolRRRRRRR!R%tchoicestallowtdroptrejectthintsno-errorR#RctdefaultRaRbR7tCommontfallbacktF5_PARTITION(R1tsupports_check_modeRYR	t
argument_specR[R(R3R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyRF�s0				(R'R(RF(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RORh(
R�RR�R�RNRft	exit_jsonRt	fail_jsonR�(tspecROtmmtresultsR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.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
RRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR-R6R:R@RBtobjectRCRNR�R�R'(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_dns.pyt<module>sF


�5
8JJ� 	

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