Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/netscaler/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pyc

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	y*ddl
mZddlm
Z
eZWnek
r�ZeZnXdd
lmZddlmZmZmZmZmZmZmZd�Zd�Zd�Zd�Z e!dkre �ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: netscaler_gslb_site
short_description: Manage gslb site entities in Netscaler.
description:
    - Manage gslb site entities in Netscaler.

version_added: "2.4.0"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:

    sitename:
        description:
            - >-
                Name for the GSLB site. Must begin with an ASCII alphanumeric or underscore C(_) character, and must
                contain only ASCII alphanumeric, underscore C(_), hash C(#), period C(.), space C( ), colon C(:), at C(@), equals
                C(=), and hyphen C(-) characters. Cannot be changed after the virtual server is created.
            - "Minimum length = 1"

    sitetype:
        choices:
            - 'REMOTE'
            - 'LOCAL'
        description:
            - >-
                Type of site to create. If the type is not specified, the appliance automatically detects and sets
                the type on the basis of the IP address being assigned to the site. If the specified site IP address
                is owned by the appliance (for example, a MIP address or SNIP address), the site is a local site.
                Otherwise, it is a remote site.

    siteipaddress:
        description:
            - >-
                IP address for the GSLB site. The GSLB site uses this IP address to communicate with other GSLB
                sites. For a local site, use any IP address that is owned by the appliance (for example, a SNIP or
                MIP address, or the IP address of the ADNS service).
            - "Minimum length = 1"

    publicip:
        description:
            - >-
                Public IP address for the local site. Required only if the appliance is deployed in a private address
                space and the site has a public IP address hosted on an external firewall or a NAT device.
            - "Minimum length = 1"

    metricexchange:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - >-
                Exchange metrics with other sites. Metrics are exchanged by using Metric Exchange Protocol (MEP). The
                appliances in the GSLB setup exchange health information once every second.
            - >-
                If you disable metrics exchange, you can use only static load balancing methods (such as round robin,
                static proximity, or the hash-based methods), and if you disable metrics exchange when a dynamic load
                balancing method (such as least connection) is in operation, the appliance falls back to round robin.
                Also, if you disable metrics exchange, you must use a monitor to determine the state of GSLB
                services. Otherwise, the service is marked as DOWN.

    nwmetricexchange:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - >-
                Exchange, with other GSLB sites, network metrics such as round-trip time (RTT), learned from
                communications with various local DNS (LDNS) servers used by clients. RTT information is used in the
                dynamic RTT load balancing method, and is exchanged every 5 seconds.

    sessionexchange:
        choices:
            - 'enabled'
            - 'disabled'
        description:
            - "Exchange persistent session entries with other GSLB sites every five seconds."

    triggermonitor:
        choices:
            - 'ALWAYS'
            - 'MEPDOWN'
            - 'MEPDOWN_SVCDOWN'
        description:
            - >-
                Specify the conditions under which the GSLB service must be monitored by a monitor, if one is bound.
                Available settings function as follows:
            - "* C(ALWAYS) - Monitor the GSLB service at all times."
            - >-
                * C(MEPDOWN) - Monitor the GSLB service only when the exchange of metrics through the Metrics Exchange
                Protocol (MEP) is disabled.
            - "C(MEPDOWN_SVCDOWN) - Monitor the service in either of the following situations:"
            - "* The exchange of metrics through MEP is disabled."
            - >-
                * The exchange of metrics through MEP is enabled but the status of the service, learned through
                metrics exchange, is DOWN.

    parentsite:
        description:
            - "Parent site of the GSLB site, in a parent-child topology."

    clip:
        description:
            - >-
                Cluster IP address. Specify this parameter to connect to the remote cluster site for GSLB auto-sync.
                Note: The cluster IP address is defined when creating the cluster.

    publicclip:
        description:
            - >-
                IP address to be used to globally access the remote cluster when it is deployed behind a NAT. It can
                be same as the normal cluster IP address.

    naptrreplacementsuffix:
        description:
            - >-
                The naptr replacement suffix configured here will be used to construct the naptr replacement field in
                NAPTR record.
            - "Minimum length = 1"


extends_documentation_fragment: netscaler
requirements:
    - nitro python sdk
sg
- name: Setup gslb site
  delegate_to: localhost
  netscaler_gslb_site:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot

    sitename: gslb-site-1
    siteipaddress: 192.168.1.1
    sitetype: LOCAL
    publicip: 192.168.1.1
    metricexchange: enabled
    nwmetricexchange: enabled
    sessionexchange: enabled
    triggermonitor: ALWAYS

s
loglines:
    description: list of logged messages by the module
    returned: always
    type: list
    sample: "['message 1', 'message 2']"

msg:
    description: Message detailing the failure reason
    returned: failure
    type: str
    sample: "Action does not exist"

diff:
    description: List of differences between the actual configured object and the configuration specified in the module
    returned: failure
    type: dict
    sample: "{ 'targetlbvserver': 'difference. ours: (str) server1 other: (str) server2' }"
(tgslbsite(tnitro_exception(t
AnsibleModule(tConfigProxytget_nitro_clienttnetscaler_common_argumentstlogtloglinestensure_feature_is_enabledtget_immutables_intersectioncC`s/tj|d|jd�dkr'tStSdS(Nssitename:%stsitenamei(Rtcount_filteredtparamstTruetFalse(tclienttmodule((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pytgslb_site_exists�s#cC`sNtj|d|jd�}|j|d�}t|�dkrFtStSdS(Nssitename:%sRi(Rtget_filteredRtdiff_objecttlenRR(RRtgslb_site_proxytgslb_site_listt	diff_dict((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pytgslb_site_identical�s
cC`s.tj|d|jd�}|j|d�S(Nssitename:%sRi(RRRR(RRRR((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pyt	diff_list�scC`s�tdtdd�dtdddddg�dtdd�d	tdd�d
tdddddg�d
tdddddg�dtdddddg�dtddddddg�dtdd�dtdd�dtdd�dtdd��}t�}t�}|jt�|j|�|j|�td|dt�}tdtdtdt�}ts~|jdd�nt	|�}y|j
�Wn�tk
r�}dt|j
�|jf}|jd|�n�tk
ro}tt|��dkr|jdd t|��qptt|��d!krR|jdd"t|��qp|jdd#t|��nXdddd	d
d
ddddddg}d$d%d&d'g}	dddd	dddg}
id(�gd
6d)�gd
6d*�gd6}td+t�d,|d-|jd.|d/|	d0|
d1|�}yXt|d2�|jd3d4kr�td5�t||�s�|js�|j�|jd6r�|j�q�nt|d<n�t|||�sQt|t|||�j��}
|
gkr|jdd7|
fd8t|||�|�n|jsD|j�|jd6rD|j�qDnt|d<n
t|d<|js�td9�t||�s�|jdd:|�nt|||�s�|jdd;d8t|||�|�q�q�n�|jd3d<kr�td=�t||�r<|js/|j�|jd6r/|j�q/nt|d<n
t|d<|js�td>�t||�r�|jdd?|�q�q�nWnBtk
r�}d@t|j
�|jf}|jd||�nX|j�|j |�dS(ANRttypetstrtsitetypetchoicestREMOTEtLOCALt
siteipaddresstpubliciptmetricexchangetenabledtdisabledtnwmetricexchangetsessionexchangettriggermonitortALWAYStMEPDOWNtMEPDOWN_SVCDOWNt
parentsitetclipt
publiccliptnaptrreplacementsuffixt
argument_spectsupports_check_modetchangedtfailedRtmsgsCould not load nitro python sdks6nitro exception during login. errorcode=%s, message=%ss-<class 'requests.exceptions.ConnectionError'>sConnection error %ss&<class 'requests.exceptions.SSLError'>sSSL Error %ss Unexpected error during login %sRtpersistencemepstatustversiont__countcS`s
|j�S(N(tupper(tv((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pyt<lambda>VscS`s
|j�S(N(R?(R@((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pyRAWscS`s
|j�S(N(R?(R@((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pyRAXstactualRtattribute_values_dicttreadwrite_attrstreadonly_attrstimmutable_attrst
transformstGSLBtstatetpresents"Applying actions for state presenttsave_configs%Cannot update immutable attributes %stdiffsSanity checks for state presentsGSLB site does not exists!GSLB site differs from configuredtabsents!Applying actions for state absentsSanity checks for state absentsGSLB site still existss(nitro exception errorcode=%s, message=%s(!tdicttupdateR
R
RRRtPYTHON_SDK_IMPORTEDt	fail_jsonRtloginR	R#t	errorcodetmessaget	ExceptionR"RRRRRRt
check_modetaddRKR RR!tkeystdeletetlogoutt	exit_json(tmodule_specific_argumentsthand_inserted_argumentsR7Rt
module_resultRteR;RDRERFRGRtimmutables_changed((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pytmain�s		


					

			

	


!	

	



	
.
	



	
 
t__main__N("t
__future__RRRR"t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNt>nssrc.com.citrix.netscaler.nitro.resource.config.gslb.gslbsiteRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionR	RRPtImportErrorR_Rtansible.module_utils.basicR
t0ansible.module_utils.network.netscaler.netscalerRRR
RRRRRR R!Rat__name__(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_gslb_site.pyt<module>s*


�

4					�

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