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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	y*ddl
mZddlm
Z
eZWnek
r�ZeZnXdd
lmZddlmZmZmZmZmZmZd�Zd�Zd�Zd�Zd�Z e!dkre �ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: netscaler_server
short_description: Manage server configuration
description:
    - Manage server entities configuration.
    - This module is intended to run either on the ansible  control node or a bastion (jumpserver) with access to the actual netscaler instance.

version_added: "2.4.0"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:
    name:
        description:
            - "Name for the server."
            - >-
                Must begin with an ASCII alphabetic 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.
            - "Can be changed after the name is created."
            - "Minimum length = 1"

    ipaddress:
        description:
            - >-
                IPv4 or IPv6 address of the server. If you create an IP address based server, you can specify the
                name of the server, instead of its IP address, when creating a service. Note: If you do not create a
                server entry, the server IP address that you enter when you create a service becomes the name of the
                server.

    domain:
        description:
            - "Domain name of the server. For a domain based configuration, you must create the server first."
            - "Minimum length = 1"

    translationip:
        description:
            - "IP address used to transform the server's DNS-resolved IP address."

    translationmask:
        description:
            - "The netmask of the translation ip."

    domainresolveretry:
        description:
            - >-
                Time, in seconds, for which the NetScaler appliance must wait, after DNS resolution fails, before
                sending the next DNS query to resolve the domain name.
            - "Minimum value = C(5)"
            - "Maximum value = C(20939)"
        default: 5

    ipv6address:
        description:
            - >-
                Support IPv6 addressing mode. If you configure a server with the IPv6 addressing mode, you cannot use
                the server in the IPv4 addressing mode.
        default: false
        type: bool

    comment:
        description:
            - "Any information about the server."

    td:
        description:
            - >-
                Integer value that uniquely identifies the traffic domain in which you want to configure the entity.
                If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID
                of 0.
            - "Minimum value = C(0)"
            - "Maximum value = C(4094)"

    graceful:
        description:
            - >-
                Shut down gracefully, without accepting any new connections, and disabling each service when all of
                its connections are closed.
            - This option is meaningful only when setting the I(disabled) option to C(true)
        type: bool
        version_added: "2.5"

    delay:
        description:
            - Time, in seconds, after which all the services configured on the server are disabled.
            - This option is meaningful only when setting the I(disabled) option to C(true)
        version_added: "2.5"

    disabled:
        description:
            - When set to C(true) the server state will be set to C(disabled).
            - When set to C(false) the server state will be set to C(enabled).
            - >-
                Note that due to limitations of the underlying NITRO API a C(disabled) state change alone
                does not cause the module result to report a changed status.
        type: bool
        default: false

extends_documentation_fragment: netscaler
requirements:
    - nitro python sdk
s�
- name: Setup server
  delegate_to: localhost
  netscaler_server:
      nsip: 172.18.0.2
      nitro_user: nsroot
      nitro_pass: nsroot

      state: present

      name: server-1
      ipaddress: 192.168.1.1
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' }
(tserver(tnitro_exception(t
AnsibleModule(tConfigProxytget_nitro_clienttnetscaler_common_argumentstlogtloglinestget_immutables_intersectioncC`s9td�tj|d|jd�dkr1tStSdS(NsChecking if server existssname:%stnamei(RRtcount_filteredtparamstTruetFalse(tclienttmodule((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.pyt
server_exists�s
#cC`s�td�tj|d|jd�dkr1tSt|||�}x*ddgD]}||krP||=qPqPW|ikr�tStSdS(Ns*Checking if configured server is identicalsname:%sRitgracefultdelay(RRRRRt	diff_listR(RRtserver_proxytdifftoption((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.pytserver_identical�s
#cC`s5|jtj|d|jd�d�f}|dS(Nsname:%sRi(tdiff_objectRtget_filteredR(RRRtret_val((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.pyR�s-cC`sR|jdr/td�tj||j�}ntd�tj||j�}|S(NtdisabledsDisabling serversEnabling server(RRRtdisabletactualtenable(RRRtresult((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.pytdo_state_change�s


cC`stdtdd�dtdd�dtdd�dtdd�dtdd�dtdd	�d
tdddt�d
tdd�dtdd�dtdd�dtdd��}tdtdddt��}t�}|jt�|j|�|j|�td|dt�}tdtdtdt�}tsK|jdd�nt	|�}y|j
�Wn�tk
r�}dt|j
�|jf}|jd|�n�tk
r<}tt|��dkr�|jddt|��q=tt|��dkr|jddt|��q=|jddt|��nXddddddd
ddd
dg}d d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g}	ddd
dg}
id7gd6d7gd
6}td8t�d9|d:|jd;|d<|	d=|
d>|�}y�|jd?d@krtdA�t||�s�|jss|j�|jdBrs|j�qsnt|d<n�t|||�s1t|t|||�j��}
|
gkr�dC|
f}|jd|dDt|||�|�n|js$|j�|jdBr$|j�q$nt|d<n
t|d<|js�t|||�}|j
dEkr�dF|j
|jf}|jd||�q�ntdG�|js�t||�s�|jddH|�nt|||�s	|jddIdDt|||�|�q	q�n�|jd?dJkr�tdK�t||�ru|jsh|j�|jdBrh|j�qhnt|d<n
t|d<tdL�|js�t||�r�|jddM|�q�q�nWnBtk
r}dNt|j
�|jf}|jd||�nX|j�|j |�dS(ONRttypetstrt	ipaddresstdomaint
translationipttranslationmasktdomainresolveretrytinttipv6addresstbooltdefaulttcommentttdtfloatRRR#t
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 %ststatechangetimesecttickssincelaststatechanget	autoscaletcustomserveridtmonthresholdt	maxclienttmaxreqtmaxbandwidthtusiptckattcpbtcmpt
clttimeoutt
svrtimeoutt	cipheadertcipt	cacheabletsctsptdownstateflusht
appflowlogtboundtdt__counttbool_yes_noR%Rtattribute_values_dicttreadwrite_attrstreadonly_attrstimmutable_attrst
transformststatetpresents"Applying actions for state presenttsave_configs%Cannot update immutable attributes %sRis<Error when setting disabled state. errorcode: %s message: %ssSanity checks for state presentsServer does not seem to exists6Server is not configured according to parameters giventabsents!Applying actions for state absentsSanity checks for state absentsServer seems to be presents(nitro exception errorcode=%s, message=%s(!tdictRtupdateR
R
RRtPYTHON_SDK_IMPORTEDt	fail_jsonRtloginR	R*t	errorcodetmessaget	ExceptionR)RRRRRt
check_modetaddR[RRRtkeysR(tdeletetlogoutt	exit_json(tmodule_specific_argumentsthand_inserted_argumentsR7Rt
module_resultRteR;RURVRWRXRtimmutables_changedtres((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.pytmain�s 		


					

			
	


!
(	



	
		
	




	 
t__main__N("t
__future__RRRR)t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNt=nssrc.com.citrix.netscaler.nitro.resource.config.basic.serverRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionR	RR_tImportErrorRnRtansible.module_utils.basicR
t0ansible.module_utils.network.netscaler.netscalerRRR
RRRRRRR(Rqt__name__(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_server.pyt<module>s,


i

.				
	�

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