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

�
�Udac@`s�dZddlmZmZmZeZidd6dgd6dd6Zd	Zd
Z	dZ
ddlZdd
lm
Z
ddlmZddljjZej�Zdefd��YZd�Zedkr�e�ndS(s� this is cifs_server module

 (c) 2018-2019, NetApp, Inc
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys#
---
module: na_ontap_cifs_server
short_description: NetApp ONTAP CIFS server configuration
extends_documentation_fragment:
    - netapp.na_ontap
version_added: '2.6'
author: NetApp Ansible Team (@carchi8py) <[email protected]>

description:
    - Creating / deleting and modifying the CIFS server .

options:

  state:
    description:
    - Whether the specified cifs_server should exist or not.
    default: present
    choices: ['present', 'absent']

  service_state:
    description:
    - CIFS Server Administrative Status.
    choices: ['stopped', 'started']

  name:
    description:
    - Specifies the cifs_server name.
    required: true
    aliases: ['cifs_server_name']

  admin_user_name:
    description:
    - Specifies the cifs server admin username.

  admin_password:
    description:
    - Specifies the cifs server admin password.

  domain:
    description:
    - The Fully Qualified Domain Name of the Windows Active Directory this CIFS server belongs to.

  workgroup:
    description:
    -  The NetBIOS name of the domain or workgroup this CIFS server belongs to.

  ou:
    description:
    - The Organizational Unit (OU) within the Windows Active Directory
      this CIFS server belongs to.
    version_added: '2.7'

  force:
    type: bool
    description:
    - If this is set and a machine account with the same name as
      specified in 'name' exists in the Active Directory, it
      will be overwritten and reused.
    version_added: '2.7'

  vserver:
    description:
    - The name of the vserver to use.
    required: true

s�
    - name: Create cifs_server
      na_ontap_cifs_server:
        state: present
        vserver: svm1
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"

    - name: Delete cifs_server
      na_ontap_cifs_server:
        state: absent
        name: data2
        vserver: svm1
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"

t
N(t
AnsibleModule(t	to_nativetNetAppOntapcifsServercB`sVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s.
    object to describe  cifs_server info
    cC`stj�|_|jjtdtdtdddgdd�dtdtddd	g�d
tdtddd
dg�dtdtdddd�dtdtdd�dtdtdd�dtdtdddt�dtdtdd�dtdtdd�dtdtdd��
�td|jdt�|_	|j	j
}|d|_|d|_|d|_
|d|_|d|_|d|_|d|_|d|_|d|_|d|_ttkr�|j	jdd�n!tjd|j	d|j�|_dS(Ntstatetrequiredtchoicestpresenttabsenttdefaultt
service_statetstoppedtstartedtnamettypetstrtaliasestcifs_server_namet	workgrouptdomaintadmin_user_nametadmin_passwordtno_logtoutforcetbooltvservert
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmodule(tnetapp_utilstna_ontap_host_argument_specR#tupdatetdicttFalsetTruetNoneR	R&tparamsRRRRR"RRRRR tHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tselfR.((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pyt__init__ys:!	









cC`s�tjjd�}tjjd�}|jd|j�|jd|j�tjjd�}|j|�|j|�|jj|t	�}d}|jd�r�t|j
d��dkr�|jd�jd�}i|jd	6|j
d
�d
6}n|S(s�
        Return details about the CIFS-server
        :param:
            name : Name of the name of the cifs_server

        :return: Details about the cifs_server. None if not found.
        :rtype: dict
        scifs-server-get-iterscifs-server-configscifs-serverR"tquerysnum-recordsisattributes-listRsadministrative-statusN(R'tzapit	NaElementt
add_new_childRR"tadd_child_elemR2tinvoke_successfullyR,R-tget_child_by_nametinttget_child_content(R3tcifs_server_infotcifs_server_attributesR5tresulttreturn_value((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytget_cifs_server�s"	

	
cC`svi|jd6|jdkr"dndd6}|jdk	rK|j|d<n|jdk	rj|j|d<n|jdk	r�|j|d<n|jdk	r�|j|d	<n|jdk	r�|j|d
<n|jdk	r�t	|j�j
�|d<ntjj
jd|�}y|jj|d
t�WnKtjjk
rq}|jjdd|jt|�fdtj��nXdS(s4
        calling zapi to create cifs_server
        scifs-serverRtuptdownsadministrative-statusRRsadmin-usernamesadmin-passwordsorganizational-unitsforce-account-overwritescifs-server-createtenable_tunnelingR%s!Error Creating cifs_server %s: %st	exceptionN(RRRR-RRRRR RtlowerR'R6R7tcreate_node_with_childrenR2R:R,t
NaApiErrorR&R0R
t	tracebackt
format_exc(R3toptionstcifs_server_createtexc((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytcreate_cifs_server�s,
cC`s�|jdkr"|jdd�ntjjjd�}y|jj|dt�WnKtjj	k
r�}|j
jdd|jt|�fdt
j��nXd	S(
s4
        calling zapi to create cifs_server
        RCtadmin_statusRDscifs-server-deleteRER%s!Error deleting cifs_server %s: %sRFN(Rtmodify_cifs_serverR'R6R7RHR2R:R,RIR&R0R
RJRK(R3tcifs_server_deleteRN((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytdelete_cifs_server�s%cC`s�tjjjdi|jd6|d6|jd6�}y|jj|dt�WnKtjj	k
r�}|j
jdd|jt|�fdt
j��nXd	S(
s*
        RModify the cifs_server.
        scifs-server-modifyscifs-serversadministrative-statusR"RER%s"Error modifying cifs_server %s: %sRFN(R'R6R7RHRR"R2R:R,RIR&R0R
RJRK(R3RPtcifs_server_modifyte((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pyRQ�s%cC`s�tjjjd�}y|jj|dt�WnKtjjk
r|}|jj	dd|j
t|�fdtj
��nXdS(s*
        RModify the cifs_server.
        scifs-server-startRER%s"Error modifying cifs_server %s: %sRFN(R'R6R7RHR2R:R,RIR&R0RR
RJRK(R3RTRU((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytstart_cifs_server�s	%cC`s�tjjjd�}y|jj|dt�WnKtjjk
r|}|jj	dd|j
t|�fdtj
��nXdS(s*
        RModify the cifs_server.
        scifs-server-stopRER%s"Error modifying cifs_server %s: %sRFN(R'R6R7RHR2R:R,RIR&R0RR
RJRK(R3RTRU((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytstop_cifs_servers	%cC`sdt}t}tjd|j�|j�}|r�t}|jdkr�|d}|jdkrt|dkrtt}n|jdkr�|dkr�t}q�q�t}n|jdkr�t}n|rM|jj	r�qM|jdkr.|s�|j
�qJ|jdkr|j�qJ|jdkrJ|j�qJqM|jdkrM|j
�qMn|jjd	|�d
S(s2
        calling all cifs_server features
        tna_ontap_cifs_serverRsadministrative-statusRRDRRCRtchangedN(R+R't
ems_log_eventR2RBR,RRR&t
check_modeRORWRVRSt	exit_json(R3RYtcifs_server_existstcifs_server_detailtadministrative_status((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytapplys8
			

(t__name__t
__module__t__doc__R4RBRORSRQRVRWR`(((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pyRts	(					
	
cC`st�}|j�dS(N(RR`(tcifs_server((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pytmainCs	t__main__(Rct
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRJtansible.module_utils.basicR	tansible.module_utils._textR
tansible.module_utils.netapptmodule_utilstnetappR'thas_netapp_libR/tobjectRReRa(((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cifs_server.pyt<module>s$

E�	

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