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

�
�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_bysa
---
module: bigip_dns_zone
short_description: Manage DNS zones on BIG-IP
description:
  - Manage DNS zones on BIG-IP. The zones managed here are primarily used
    for configuring DNS Express on BIG-IP. This module does not configure
    zones that are found in BIG-IP ZoneRunner.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the DNS zone.
      - The name must begin with a letter and contain only letters, numbers,
        and the underscore character.
    type: str
    required: True
  dns_express:
    description:
      - DNS express related settings.
    type: dict
    suboptions:
      server:
        description:
          - Specifies the back-end authoritative DNS server from which the BIG-IP
            system receives AXFR zone transfers for the DNS Express zone.
        type: str
      enabled:
        description:
          - Specifies the current status of the DNS Express zone.
        type: bool
      notify_action:
        description:
          - Specifies the action the system takes when a NOTIFY message is received
            for this DNS Express zone.
          - If a TSIG key is configured for the zone, the signature is only validated
            for C(consume) and C(repeat) actions.
          - When C(consume), the NOTIFY message is seen only by DNS Express.
          - When C(bypass), the NOTIFY message does not go to DNS Express, but
            instead goes to a back-end DNS server (subject to the value of the
            Unhandled Query Action configured in the DNS profile applied to the
            listener that handles the DNS request).
          - When C(repeat), the NOTIFY message goes to both DNS Express and any
            back-end DNS server.
        type: str
        choices:
          - consume
          - bypass
          - repeat
      allow_notify_from:
        description:
          - Specifies the IP addresses from which the system accepts NOTIFY messages
            for this DNS Express zone.
        type: list
      verify_tsig:
        description:
          - Specifies whether the system verifies the identity of the authoritative
            nameserver that sends updated information for this DNS Express zone.
        type: bool
      response_policy:
        description:
          - Specifies whether this DNS Express zone is a DNS response policy zone (RPZ).
        type: bool
  nameservers:
    description:
      - Specifies the DNS nameservers to which the system sends NOTIFY messages.
    type: list
  tsig_server_key:
    description:
      - Specifies the TSIG key the system uses to authenticate the back-end DNS
        authoritative server that sends AXFR zone transfers to the BIG-IP system.
    type: str
  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)
  - Greg Crosby (@crosbygw)
s_
- name: Create a DNS zone for DNS express
  bigip_dns_zone:
    name: zone.foo.com
    dns_express:
      enabled: yes
      server: dns-lab
      allow_notify_from:
        - 192.168.39.10
      notify_action: consume
      verify_tsig: no
      response_policy: no
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Disable DNS express zone, change server, and modify notify_action to bypass
  bigip_dns_zone:
    name: zone.foo.com
    dns_express:
      enabled: no
      server: foo1.server.com
      allow_notify_from:
        - 192.168.39.10
      notify_action: bypass
      verify_tsig: no
      response_policy: no
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Add nameservers
  bigip_dns_zone:
    name: zone.foo.com
    nameservers:
      - foo1.nameserver.com
      - foo2.nameserver.com
      - foo3.nameserver.com
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove nameserver
  bigip_dns_zone:
    name: zone.foo.com
    nameservers:
      - foo1.nameserver.com
      - foo2.nameserver.com
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove all nameservers
  bigip_dns_zone:
    name: zone.foo.com
    nameservers: none
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Add tsig_server_key
  bigip_dns_zone:
    name: zone.foo.com
    tsig_server_key: key1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove tsig_server_key
  bigip_dns_zone:
    name: zone.foo.com
    tsig_server_key: none
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove zone
  bigip_dns_zone:
    name: zone.foo.com
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

s�
enabled:
  description: Whether the zone is enabled or not.
  returned: changed
  type: bool
  sample: yes
allow_notify_from:
  description: The new DNS Express Allow NOTIFY From value.
  returned: changed
  type: list
  sample: ['1.1.1.1', '2.2.2.2']
notify_action:
  description: The new DNS Express Notify Action value.
  returned: changed
  type: str
  sample: consume
verify_tsig:
  description: The new DNS Express Verify Notify TSIG value.
  returned: changed
  type: bool
  sample: yes
express_server:
  description: The new DNS Express Server value.
  returned: changed
  type: str
  sample: server1
response_policy:
  description: The new DNS Express Response Policy value.
  returned: changed
  type: bool
  sample: no
nameservers:
  description: The new Zone Transfer Clients Nameservers value.
  returned: changed
  type: list
  sample: ['/Common/server1', '/Common/server2']
tsig_server_key:
  description: The new TSIG Server Key value.
  returned: changed
  type: str
  sample: /Common/key1
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tflatten_boolean(tcmp_simple_listt
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6dd
6dd6Zddddd	dd
dgZdddddd
ddgZdddddd
ddgZRS(tenabledtdnsExpressEnabledtallow_notify_fromtdnsExpressAllowNotifyt
notify_actiontdnsExpressNotifyActiontverify_tsigtdnsExpressNotifyTsigVerifytexpress_servertdnsExpressServertresponse_policytresponsePolicytnameserversttransferClientsttsig_server_keyt
serverTsigKey(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRsB
		t
ApiParameterscB`seZRS((R#R$(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR)AstModuleParameterscB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
RS(cC`styU|jdddkrdS|jdddkr9dSt|j|jdd�SWnttfk
rodSXdS(Ntdns_expresstserverttnone(R-R.(t_valuestNoneR
t	partitiont	TypeErrortKeyError(tself((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRFscC`su|jddkrdSt|jd�dkrK|jdddkrKdSg|jdD]}t|j|�^qYS(NRiiR-R.(R-snone(R/R0tlenR
R1(R4tx((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRQs
0cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NR!R-R.(R-snone(R/R0R
R1(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR!Ys
cC`s8yt|jdd�SWnttfk
r3dSXdS(NR+R(RR/R2R3R0(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRascC`s8yt|jdd�SWnttfk
r3dSXdS(NR+R(RR/R2R3R0(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRhscC`s2y|jddSWnttfk
r-dSXdS(NR+R(R/R2R3R0(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRoscC`s8yt|jdd�SWnttfk
r3dSXdS(NR+R(RR/R2R3R0(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRvscC`snyO|jdd}|dkr$dSt|�dkrJ|ddkrJdS|SWnttfk
ridSXdS(NR+RiiR-R.(R-snone(R/R0R5R2R3(R4tv((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR}s"(R#R$tpropertyRRR!RRRRR(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR*EstChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R'tgetattrt_filter_paramst	Exception(R4tresultt
returnable((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyt	to_return�s
(R#R$R?(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR9�st
UsableChangescB`seZRS((R#R$(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR@�stReportableChangescB`seZRS((R#R$(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRA�st
DifferencecB`sbeZdd�Zd�Zed��Zed��Zed��Zed��Z	d�Z
RS(cC`s||_||_dS(N(twantthave(R4RCRD((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R:tAttributeErrort_Difference__default(R4tparamR=((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pytcompare�s

cC`st|jj|jj�S(N(RRCRRD(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR�scC`st|jj|jj�S(N(RRCRRD(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR�scC`sd|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkr`|jjSdS(NR-(RCRR0RD(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR�s$cC`sd|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkr`|jjSdS(NR-(RCR!R0RD(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR!�s$cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R:RCRDRF(R4RHtattr1tattr2((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyt	__default�s
N(R#R$R0RERIR8RRRR!RG(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRB�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(tgetR0RNR
ROtclientR*RCR)RDR@tchanges(R4targstkwargs((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRE�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRO(RR'R:RCR0R@RR(R4tchangedtkey((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.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(NRO(RBRCRDRR(tdictRIR0t
isinstancetupdateR@RRtTruetFalse(R4tdiffR(RUtktchange((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(R`R[R\(R4R=((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRORU(R\RXRCtstateRbRcRARRR?RZt_announce_deprecations(R4RUR=Rdt
reportableRR((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRQRNt	deprecate(R4R=twarningstwarning((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRes


cC`s$|j�r|j�S|j�SdS(N(texistsRZtcreate(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRbs
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/dns/zone/{2}R,tserver_porti�tcode(tformatRQtproviderRRCR1tnametapiRPtjsont
ValueErrorR\RR[(R4turitresptresponse((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRos


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRDRaR\RNt
check_modeR[tupdate_on_device(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRZ$s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RNR}R[tremove_from_deviceRoR(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pytremove-s
cC`s(|j�|jjrtS|j�tS(N(RWRNR}R[tcreate_on_device(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRp5s


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(NRuR1s%https://{0}:{1}/mgmt/tm/ltm/dns/zone/R,RqRwRri�i�tmessage(i�i�(RRt
api_paramsRCRuR1RsRQRtRvtpostRwRxRtstrtcontent(R4RORyRzR{tex((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.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/ltm/dns/zone/{2}R,RqRwRri�R�(RRR�RsRQRtRRCR1RuRvtpatchRwRxRR�R�(R4RORyRzR{R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR~Ps

cC`s|j�r|j�StS(N(RoR�R\(R4((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRccs
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns(https://{0}:{1}/mgmt/tm/ltm/dns/zone/{2}R,Rqi�(
RsRQRtRRCR1RuRvtdeleteRR[RR�(R4RyR{((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRhs

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/dns/zone/{2}R,RqRri�R�RO(RsRQRtRRCR1RuRvRPRwRxRR�R�R)(R4RyRzR{R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR|ss

(R#R$RERWR`RaRgReRbRoRZR�RpR�R~RcRR|(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRM�s 																tArgumentSpeccB`seZd�ZRS(cC`st|_tdtdt�dtdddtdt�dtdd	�d
tddd
dg�dtdd�dtdd	�dtdd	���dtdd�dtdt�dtdddtdgf�dtdddddg��}i|_|jjt�|jj|�dS(NRutrequiredR+ttypeRXtoptionsR,RtboolRtchoicestconsumetbypasstrepeatRtlistRRRR!tno_logR1tdefaulttCommontfallbacktF5_PARTITIONRdRbRc(R[tsupports_check_modeRXR	t
argument_specRZR(R4R�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyRE�s0			(R#R$RE(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RNRi(
R�RR�R�RMRgt	exit_jsonRt	fail_jsonR�(tspecRNtmmtresultsR�((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.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
RRRt'library.module_utils.network.f5.compareRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.compareRR)R*R9R@RAtobjectRBRMR�R�R#(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_zone.pyt<module>sN


\f+
.E0�"	

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