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

�
�Udac@`s#ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZydddlm
Z
dd
lmZddlmZddlmZddlmZddlmZWnqek
r9ddlm
Z
dd
lmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZ d$�Z!e"d%kre!�nd&S('i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatust	certifiedtsupported_bys-
---
module: bigip_device_dns
short_description: Manage BIG-IP device DNS settings
description:
  - Manage BIG-IP device DNS settings.
version_added: 2.2
options:
  cache:
    description:
      - Specifies whether the system caches DNS lookups or performs the
        operation each time a lookup is needed. Please note that this applies
        only to Access Policy Manager features, such as ACLs, web application
        rewrites, and authentication.
    type: str
    choices:
       - enabled
       - disabled
       - enable
       - disable
  name_servers:
    description:
      - A list of name servers that the system uses to validate DNS lookups
    type: list
  search:
    description:
      - A list of domains that the system searches for local domain lookups,
        to resolve local host names.
    type: list
  ip_version:
    description:
      - Specifies whether the DNS specifies IP addresses using IPv4 or IPv6.
    type: int
    choices:
      - 4
      - 6
  state:
    description:
      - The state of the variable on the system. When C(present), guarantees
        that an existing variable is set to C(value).
    type: str
    choices:
      - absent
      - present
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s 
- name: Set the DNS settings on the BIG-IP
  bigip_device_dns:
    name_servers:
      - 208.67.222.222
      - 208.67.220.220
    search:
      - localdomain
      - lab.local
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
cache:
  description: The new value of the DNS caching
  returned: changed
  type: str
  sample: enabled
name_servers:
  description: List of name servers that were set
  returned: changed
  type: list
  sample: ['192.0.2.10', '172.17.12.10']
search:
  description: List of search domains that were set
  returned: changed
  type: list
  sample: ['192.0.2.10', '172.17.12.10']
ip_version:
  description: IP version that was set that DNS will specify IP addresses in
  returned: changed
  type: int
  sample: 4
warnings:
  description: The list of warnings (if any) generated by module based on arguments
  returned: always
  type: list
  sample: ['...', '...']
(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(t
is_empty_listt
ParameterscB`sbeZidd6dd6dd6ZdddgZddddgZddddgZddgZRS(tcaches	dns.cachetname_serverstnameServerst
ip_versiontincludetsearch(t__name__t
__module__tapi_maptapi_attributest
updatablestreturnablestabsentables(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s
t
ApiParameterscB`seZRS((RR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�stModuleParameterscB`sDeZed��Zed��Zed��Zed��ZRS(cC`sl|jd}|dkrdSt|t�rX|dkrXt�}|jt|��|St|�rhgS|S(NRt(t_valuestNonet
isinstancetstrtlisttappendR(tselfRtresult((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s
	cC`sl|jd}|dkrdSt|t�rX|dkrXt�}|jt|��|St|�rhgS|S(NRR(R R!R"R#R$R%R(R&RR'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s
	cC`s<|jddkrdSt|jd�dkr4dSdSdS(NRtenabledtenabletdisable(R(R)(R R!R#(R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s
cC`s6|jddkrdS|jddkr.dSdSdS(NRis
options inet6iR(R R!(R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s
(RRtpropertyRRRR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s

	tChangescB`seZd�ZRS(cC`s}i}y_xI|jD]>}t||�}t|t�rG|j|�q|||<qW|j|�}Wntk
rxnX|S(N(RtgetattrR"tdicttupdatet_filter_paramst	Exception(R&R't
returnabletchange((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt	to_return�s
(RRR4(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR,�st
UsableChangescB`seZRS((RR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR5�stReportableChangescB`seZed��ZRS(cC`s6|jddkrdS|jddkr.dSdSdS(NRs
options inet6iRi(R R!(R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s
(RRR+R(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR6�st
DifferencecB`sSeZdd�Zd�Zd�Zed��Zed��Zed��Z	RS(cC`s||_||_dS(N(twantthave(R&R8R9((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R-tAttributeErrort_Difference__default(R&tparamR'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R-R8R9R;(R&R=tattr1tattr2((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt	__default�s
cC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkrZdS|jj|jjkr||jjSdS(NR(R8RR!R9(R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR�s$cC`sS|jj}|jjdkr"dS|dkr�|jjdkrP|jjrPdSt|jj�t|jj�krxgSt|jj�t|jj�kr�tt|jj�j|jj��Sn|jjs|jjdkr�dS|jjdk	r|jjSn|jjdkr!|jjSt|jj�t|jj�krO|jjSdS(Ntabsent(R8tstateRR!R9tsetR$t
difference(R&RC((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR	s&$$(

$cC`sS|jj}|jjdkr"dS|jjsc|jjdkrDdS|jjdk	rc|jjSn|dkr|jjdkr�|jjr�dSt|jj�t|jj�kr�gSt|jj�t|jj�krtt|jj�j|jj��Sn|jjdkr!|jjSt|jj�t|jj�krO|jjSdS(NRB(R8RCRR!R9RDR$RE(R&RC((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyRs&
$$(
$N(
RRR!R:R>R<R+RRR(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR7�s			t
ModuleManagercB`s}eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tpopR!RGR	RHtclientRR8RR9R5tchanges(R&targstkwargs((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR:7s
cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(RIRGt	deprecate(R&R'twarningstwarning((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt_announce_deprecations>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(NRH(R7R8R9RRR.R>R!R"R/R5RKtTruetFalse(R&tdiffRtchangedtkR3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt_update_changed_optionsFs		
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(NRH(R7R8R9RRR.R>R!R"R/R5RKRURV(R&RWRRXRYR3((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt_absent_changed_optionsXs		
cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j|�|jtd|��|j	|�|S(NtpresentRBRHRX(
RVR.R8RCR/RBR6RKR4RT(R&RXR'RCt
reportableRK((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pytexec_modulejs	

cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR9t
should_updateRVRGt
check_modeRUtupdate_on_device(R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR/{s
cC`s|j�}|rtStS(N(RZRURV(R&R'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR`�scC`s|j�}|rtStS(N(R[RURV(R&R'((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt
should_absent�scC`s=|j�|_|j�stS|jjr/tS|j�tS(N(R_R9RcRVRGRaRUtabsent_on_device(R&((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyRB�s
cC`s�dj|jjd|jjdd�}|jjj|�}y|j�}Wn%tk
ru}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��n|S(Ns"https://{0}:{1}/mgmt/tm/sys/db/{2}tservertserver_ports	dns.cachetcodei�tmessage(
tformatRJtprovidertapitgettjsont
ValueErrorR
R#tcontent(R&turitresptresponsetex((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pytread_dns_cache_setting�s

	cC`s�|j�}dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
r~}tt	|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��n|r�|d|d<ntd	|�S(
Ns https://{0}:{1}/mgmt/tm/sys/dns/ReRfRgi�RhtvalueRRH(RtRiRJRjRkRlRmRnR
R#RoR(R&RRpRqRrRs((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR_�s 
cC`s�|jj�}|r�dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��q�n|jj
r�dj|jjd|jjdd	�}i|jj
d
6}|jjj|d|�}y|j�}Wn%tk
rx}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��q�ndS(Ns https://{0}:{1}/mgmt/tm/sys/dns/ReRfRmRgi�Rhs"https://{0}:{1}/mgmt/tm/sys/db/{2}s	dns.cacheRu(RKt
api_paramsRiRJRjRktpatchRmRnR
R#RoR8R(R&RHRpRqRrRstpayload((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyRb�s:


	cC`s�|jj�}dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ndS(Ns https://{0}:{1}/mgmt/tm/sys/dns/ReRfRmRgi�Rh(RKRvRiRJRjRkRwRmRnR
R#Ro(R&RHRpRqRrRs((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyRd�s
(RRR:RTRZR[R^R/R`RcRBRtR_RbRd(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyRF6s														%tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdddddg�dtdd	�d
tdd	�dtddd
gdd�dtdddddg��}i|_|jjt�|jj|�dd
ddgg|_dS(NRtchoicestdisabledR(R*R)RttypeR$RRiitintRCtdefaultR\RB(RUtsupports_check_modeR.t
argument_specR/R
trequired_one_of(R&R�((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyR:�s$					(RRR:(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyRy�scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�RR�RGRO(RyRR�RR�RFR^t	exit_jsonR
t	fail_jsonR#(tspecRGtmmtresultsRs((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pytmains			t__main__N(#t
__future__RRRR|t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt%library.module_utils.network.f5.bigipR	t&library.module_utils.network.f5.commonR
RRR
RtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRRRR,R5R6tobjectR7RFRyR�R(((sO/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_device_dns.pyt<module>sD


3
.M�	

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