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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
yddlmZe
ZWnek
r�ZeZnXdd
lmZddlmZmZmZmZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysV
---
module: netscaler_save_config
short_description: Save Netscaler configuration.
description:
    - This module unconditionally saves the configuration on the target netscaler node.
    - This module does not support check mode.
    - 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:
    nsip:
        description:
            - The ip address of the netscaler appliance where the nitro API calls will be made.
            - "The port can be specified with the colon (:). E.g. C(192.168.1.1:555)."
        required: True

    nitro_user:
        description:
            - The username with which to authenticate to the netscaler node.
        required: True

    nitro_pass:
        description:
            - The password with which to authenticate to the netscaler node.
        required: True

    nitro_protocol:
        choices: [ 'http', 'https' ]
        default: http
        description:
            - Which protocol to use when accessing the nitro API objects.

    validate_certs:
        description:
            - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
        required: false
        default: 'yes'
        type: bool

    nitro_timeout:
        description:
            - Time in seconds until a timeout error is thrown when establishing a new session with Netscaler.
        default: 310

requirements:
    - nitro python sdk
sR
---
- name: Save netscaler configuration
  delegate_to: localhost
  netscaler_save_config:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot

- name: Setup server without saving  configuration
  delegate_to: localhost
  notify: Save configuration
  netscaler_server:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot

    save_config: no

    name: server-1
    ipaddress: 192.168.1.1

# Under playbook's handlers

- name: Save configuration
  delegate_to: localhost
  netscaler_save_config:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot
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"

N(tnitro_exception(t
AnsibleModule(tget_nitro_clienttlogtloglinestnetscaler_common_argumentscC`s�tjt�}|d=|d=td|dt�}tdtdtdt�}tsf|jdd	�nt	|�}y|j
�Wn�tk
r�}d
t|j
�|jf}|jd|�n�tk
rW}tt|��dkr|jddt|��qXtt|��d
kr:|jddt|��qX|jddt|��nXytd�|j�WnDtk
r�}dt|j
�d|j}|jd||�nX|j�|j|�dS(Ntstatetsave_configt
argument_spectsupports_check_modetchangedtfailedRtmsgsCould 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 %ssSaving configurationsnitro exception errorcode=s	,message=(tcopytdeepcopyR
R	tFalsetdictRtPYTHON_SDK_IMPORTEDt	fail_jsonR
tloginRtstrt	errorcodetmessaget	ExceptionttypeRRtlogoutt	exit_json(Rtmodulet
module_resulttclientteR((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_save_config.pytmains@		

t__main__(t
__future__RRRR t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRt:nssrc.com.citrix.netscaler.nitro.exception.nitro_exceptionRtTrueRtImportErrorR&Rtansible.module_utils.basicR	t0ansible.module_utils.network.netscaler.netscalerR
RRR
R't__name__(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/netscaler_save_config.pyt<module>s$


5 

"	2

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