Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/netapp/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bysy
module: na_ontap_ntp
short_description: NetApp ONTAP NTP server
extends_documentation_fragment:
    - netapp.na_ontap
version_added: '2.6'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Create or delete or modify NTP server in ONTAP
options:
  state:
    description:
    - Whether the specified NTP server should exist or not.
    choices: ['present', 'absent']
    default: 'present'
  server_name:
    description:
    - The name of the NTP server to manage.
    required: True
  version:
    description:
    - give version for NTP server
    choices: ['auto', '3', '4']
    default: 'auto'
s�
    - name: Create NTP server
      na_ontap_ntp:
        state: present
        version: auto
        server_name: "{{ server_name }}"
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
    - name: Delete NTP server
      na_ontap_ntp:
        state: absent
        server_name: "{{ server_name }}"
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
t
N(t
AnsibleModule(t	to_nativetNetAppOntapNTPServercB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s% object initialize and class methods cC`stj�|_|jjtdtdtdddgdd�dtdtdd	�d
tdtdd	dddddd
g���td|jdt�|_|jj	}|d|_
|d|_|d
|_t
tkr�|jjdd�ntjd|j�|_dS(Ntstatetrequiredtchoicestpresenttabsenttdefaulttserver_namettypetstrtversiontautot3t4t
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmodule(tnetapp_utilstna_ontap_host_argument_specRtupdatetdicttFalsetTrueR	RtparamsRRRtHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tselft
parameters((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pyt__init__Hs$	



cC`stjjd�}tjjd�}|jd|j�tjjd�}|j|�|j|�|jj|t�}d	}|j
d�rt|jd��dkr|j
d�j
d�jd�}|j
d�j
d�jd�}i|d6|d6}n|S(
s�
        Return details about the ntp server
        :param:
            name : Name of the server_name
        :return: Details about the ntp server. None if not found.
        :rtype: dict
        sntp-server-get-itersntp-server-infosserver-nametquerysnum-recordsisattributes-listRN(
Rtzapit	NaElementt
add_new_childRtadd_child_elemR'tinvoke_successfullyR"tNonetget_child_by_nametinttget_child_content(R(tntp_itertntp_infoR+tresulttreturn_valuetntp_server_nametserver_version((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pytget_ntp_serverds(

				
cC`s�tjjjdi|jd6|jd6�}y|jj|dt�WnKtjj	k
r�}|j
jdd|jt|�fdt
j��nXdS(	s$
        create ntp server.
        sntp-server-createsserver-nameRtenable_tunnelingRs Error creating ntp server %s: %st	exceptionN(RR,R-tcreate_node_with_childrenRRR'R0R"t
NaApiErrorRR%R
t	tracebackt
format_exc(R(tntp_server_createterror((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pytcreate_ntp_server�scC`s�tjjjdi|jd6�}y|jj|dt�WnKtjjk
r�}|j	j
dd|jt|�fdtj
��nXdS(s$
        delete ntp server.
        sntp-server-deletesserver-nameR<Rs Error deleting ntp server %s: %sR=N(RR,R-R>RR'R0R"R?RR%R
R@RA(R(tntp_server_deleteRC((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pytdelete_ntp_server�scC`s�tjjjdi|jd6|jd6�}y|jj|dt�WnKtjj	k
r�}|j
jdd|jt|�fdt
j��nXdS(	s%
        modify the version.
        sntp-server-modifysserver-nameRR<Rs-Error modifying version for ntp server %s: %sR=N(RR,R-R>RRR'R0R"R?RR%R
R@RA(R(tntp_modify_versoinRC((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pytmodify_version�scC`sZt}t}tj|j�}tjd|jd|�}tjd|�|j�}|dk	r�|j	dkryt
}q�|j	dkr�|jr�|j|dkr�t
}t
}q�q�n|j	dkr�t
}n|rC|jjr�qC|j	dkr$|dkr|j
�q@|r@|j�q@qC|j	dkrC|j�qCn|jjd|�dS(	sApply action to ntp-serverRtvservertna_ontap_ntpRRRtchangedN(R!Rtget_cserverR'R&Rt
ems_log_eventR;R1RR"Rt
check_modeRDRHRFt	exit_json(R(RKt
ntp_modifytresultstcservertntp_server_details((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pytapply�s6			
(	t__name__t
__module__t__doc__R*R;RDRFRHRT(((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pyRFs		#			cC`st�}|j�dS(s Create object and call apply N(RRT(tntp_obj((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pytmain�s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR@tansible.module_utils.basicR	tansible.module_utils._textR
tansible.module_utils.netapptmodule_utilstnetappRthas_netapp_libR$tobjectRRYRU(((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_ntp.pyt<module>s 


�	

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