�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
y d d l m Z e
Z Wn e k
r� Z e Z n Xd d
l m Z d d l m Z m Z m Z m Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust 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( t nitro_exception( t
AnsibleModule( t get_nitro_clientt logt loglinest netscaler_common_argumentsc C` s� t j t � } | d =| d =t d | d t � } t d t d t d t � } t sf | j d d � n t | � } y | j
� Wn� t k
r� } d
t | j
� | j f } | j d | � n� t k
rW} t t | � � d k r| j d d t | � � qXt t | � � d
k r:| j d d t | � � qX| j d d t | � � n Xy t d � | j � WnD t k
r�} d t | j
� d | j } | j d | | � n X| j � | j | � d S( Nt statet save_configt
argument_spect supports_check_modet changedt failedR t msgs Could not load nitro python sdks6 nitro exception during login. errorcode=%s, message=%ss- <class 'requests.exceptions.ConnectionError'>s Connection error %ss&