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

�
�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_bysa	
---
module: bigip_dns_nameserver
short_description: Manage LTM DNS nameservers on a BIG-IP
description:
  - Manages LTM DNS nameservers on a BIG-IP. These nameservers form part of what is
    known as DNS Express on a BIG-IP. This module does not configure GTM related
    functionality, nor does it configure system-level name servers that affect the
    base system's ability to resolve DNS names.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the nameserver.
    type: str
    required: True
  address:
    description:
      - Specifies the IP address on which the DNS nameserver (client) or back-end DNS
        authoritative server (DNS Express server) listens for DNS messages.
      - When creating a new nameserver, if this value is not specified, the default
        is C(127.0.0.1).
    type: str
  service_port:
    description:
      - Specifies the service port on which the DNS nameserver (client) or back-end DNS
        authoritative server (DNS Express server) listens for DNS messages.
      - When creating a new nameserver, if this value is not specified, the default
        is C(53).
    type: str
  route_domain:
    description:
      - Specifies the local route domain that the DNS nameserver (client) or back-end
        DNS authoritative server (DNS Express server) uses for outbound traffic.
      - When creating a new nameserver, if this value is not specified, the default
        is C(0).
    type: str
  tsig_key:
    description:
      - Specifies the TSIG key the system uses to communicate with this DNS nameserver
        (client) or back-end DNS authoritative server (DNS Express server) for AXFR zone
        transfers.
      - If the nameserver is a client, then the system uses this TSIG key to verify the
        request and sign the response.
      - If this nameserver is a DNS Express server, then this TSIG key must match the
        TSIG key for the zone on the back-end DNS authoritative server.
    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)
s�
- name: Create a nameserver
  bigip_dns_nameserver:
    name: foo
    address: 10.10.10.10
    service_port: 53
    state: present
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s

address:
  description: Address which the nameserver listens for DNS messages.
  returned: changed
  type: str
  sample: 127.0.0.1
service_port:
  description: Service port on which the nameserver listens for DNS messages.
  returned: changed
  type: int
  sample: 53
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_namet
ParameterscB`sYeZidd6dd6dd6ZddddgZddddgZddddgZRS(troute_domaintrouteDomaintservice_porttportttsig_keyttsigKeytaddress(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRs 
		t
ApiParameterscB`seZRS((RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR�stModuleParameterscB`s5eZed��Zed��Zed��ZRS(cC`s5|jddkr|jdSt|j|jd�S(NRt(NR (t_valuestNoneR
t	partition(tself((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR�scC`s.|jddkrdSt|j|jd�S(NR(R!R"R
R#(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR�scC`sP|jddkrdSyt|jd�SWntk
rKtd��nXdS(NRs+The 'service_port' must be in numeric form.(R!R"tintt
ValueErrorR(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR�s
(RRtpropertyRRR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R$tresultt
returnable((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyt	to_return�s
(RRR.(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR(�st
UsableChangescB`seZRS((RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR/�stReportableChangescB`seZRS((RR(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR0�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R$R2R3((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.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_dns_nameserver.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R)R2R3R5(R$R7tattr1tattr2((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyt	__default�s
cC`sd|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkr`|jjSdS(NR (R2RR"R3(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR�s$N(RRR"R4R8R6R'R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR1�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(tgetR"R=R
R>tclientRR2RR3R/tchanges(R$targstkwargs((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR4�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR>(RRR)R2R"R/RA(R$tchangedtkey((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.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(NR>(R1R2R3RRtdictR8R"t
isinstancetupdateR/RAtTruetFalse(R$tdiffRRDtktchange((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RORJRK(R$R,((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyt
should_updatescC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR>RD(RKRGR2tstateRQRRR0RAR.RIt_announce_deprecations(R$RDR,RSt
reportableRA((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pytexec_modules	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR@R=t	deprecate(R$R,twarningstwarning((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRT&s


cC`s$|j�r|j�S|j�SdS(N(texistsRItcreate(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRQ.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/dns/nameserver/{2}tservertserver_porti�tcode(tformatR@tproviderRR2R#tnametapiR?tjsonR&RKRRJ(R$turitresptresponse((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR^4s


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR3RPRKR=t
check_modeRJtupdate_on_device(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRICs
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(R=RlRJtremove_from_deviceR^R(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pytremoveLs
cC`s�|jjdkr,|jjidd6�n|jjdkrX|jjidd6�n|jjdkr�|jjidd6�n|j�|jjr�t	S|j
�t	S(Ns	127.0.0.1Rt53Rs	/Common/0R(R2RR"RIRRRFR=RlRJtcreate_on_device(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR_Ts

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(NReR#s+https://{0}:{1}/mgmt/tm/ltm/dns/nameserver/R`RaRgRbi�i�tmessage(i�i�(RAt
api_paramsR2ReR#RcR@RdRftpostRgR&Rtstrtcontent(R$R>RhRiRjtex((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRqas
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/nameserver/{2}R`RaRgRbi�Rr(RARsRcR@RdRR2R#ReRftpatchRgR&RRuRv(R$R>RhRiRjRw((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRmus

cC`s|j�r|j�StS(N(R^RoRK(R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRR�s
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns.https://{0}:{1}/mgmt/tm/ltm/dns/nameserver/{2}R`Rai�(
RcR@RdRR2R#ReRftdeleteRRJRRv(R$RhRj((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRn�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/dns/nameserver/{2}R`RaRbi�RrR>(RcR@RdRR2R#ReRfR?RgR&RRuRvR(R$RhRiRjRw((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRk�s

(RRR4RFRORPRVRTRQR^RIRoR_RqRmRRRnRk(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR<�s 												
				tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dt�dt�dtdt�dtd	d
dd
dg�d
td	ddtdgf��}i|_|jjt�|jj|�dS(NRetrequiredRRRRtno_logRStdefaultRQtchoicesRRR#tCommontfallbacktF5_PARTITION(RJtsupports_check_modeRGR	t
argument_specRIR(R$R�((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyR4�s 					(RRR4(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyRz�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�R=RX(
RzRR�R�R<RVt	exit_jsonRt	fail_jsonRu(tspecR=tmmtresultsRw((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pytmain�s		t__main__N($t
__future__RRRttypet
__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.commonRRRR(R/R0tobjectR1R<RzR�R(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_dns_nameserver.pyt<module>sF


B

�	

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