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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZej�ZyddlZWnek
r�eZnXdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�

module: na_elementsw_ldap

short_description: NetApp Element Software Manage ldap admin users
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Enable, disable ldap, and add ldap users

options:

    state:
        description:
        - Whether the specified volume should exist or not.
        required: true
        choices: ['present', 'absent']

    authType:
        description:
        - Identifies which user authentication method to use.
        choices: ['DirectBind', 'SearchAndBind']

    groupSearchBaseDn:
        description:
        - The base DN of the tree to start the group search (will do a subtree search from here)

    groupSearchType:
        description:
        - Controls the default group search filter used
        choices: ['NoGroup', 'ActiveDirectory', 'MemberDN']

    serverURIs:
        description:
        - A comma-separated list of LDAP server URIs

    userSearchBaseDN:
        description:
        - The base DN of the tree to start the search (will do a subtree search from here)

    searchBindDN:
        description:
        - A dully qualified DN to log in with to perform an LDAp search for the user (needs read access to the LDAP directory).

    searchBindPassword:
        description:
        - The password for the searchBindDN account used for searching

    userSearchFilter:
        description:
        - the LDAP Filter to use

    userDNTemplate:
        description:
        - A string that is used form a fully qualified user DN.

    groupSearchCustomFilter:
        description:
        - For use with the CustomFilter Search type
su
    - name: disable ldap authentication
      na_elementsw_ldap:
        state: absent
        username: "{{ admin username }}"
        password: "{{ admin password }}"
        hostname: "{{ hostname }}"

    - name: Enable ldap authentication
      na_elementsw_ldap:
        state: present
        username: "{{ admin username }}"
        password: "{{ admin password }}"
        hostname: "{{ hostname }}"
        authType: DirectBind
        serverURIs: ldap://svmdurlabesx01spd_ldapclnt
        groupSearchType: MemberDN
        userDNTemplate:  uid=%USERNAME%,cn=users,cn=accounts,dc=corp,dc="{{ company name }}",dc=com


s

N(t
AnsibleModule(t	to_nativetNetappElementLdapcB`s5eZd�Zd�Zd�Zd�Zd�ZRS(cC`stj�|_|jjdtdddtdddg�dtdddd	d
g�dtdd�dtdddd
ddg�dtdd�dtdd�dtdd�dtdddt�dtdd�dtdd�dtdd��td|jdt�|_|jj}|d|_	|d|_
|d|_|d|_|d|_
|j
dk	r�|j
jd�|_
n|d|_|d|_|d|_|d|_|d|_|d|_ttkr�|jjdd�ntjd|j�|_dS(NtstatettypetstrtrequiredtchoicestabsenttpresenttauthTypet
DirectBindt
SearchAndBindtgroupSearchBaseDntgroupSearchTypetNoGrouptActiveDirectorytMemberDNt
serverURIstuserSearchBaseDNtsearchBindDNtsearchBindPasswordtno_logtuserSearchFiltertuserDNTemplatetgroupSearchCustomFiltert
argument_spectsupports_check_modet,tmsgs)Unable to import the SolidFire Python SDKtmodule(tnetapp_utilstontap_sf_host_argument_specR"tupdatetdicttTrueRR&tparamsRRRRRtNonetsplitRRRRR R!t
HAS_SF_SDKtFalset	fail_jsontcreate_sf_connectiontsfe(tselftparam((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pyt__init__usB!	










cC`s|jj�}|S(s�
            Return ldap configuration if found

            :return: Details about the ldap configuration. None if not found.
            :rtype: solidfire.models.GetLdapConfigurationResult
        (R3tget_ldap_configuration(R4tldap_config((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pyR7�scC`s�yh|jj|jd|jd|jd|jd|jd|jd|jd|j	d|j
d	|j�	WnKtj
jk
r�}|jjd
d|jt|�fdtj��nXd
S(s6
        Enable LDAP
        :return: nothing
        t	auth_typetgroup_search_base_dntgroup_search_typetgroup_search_custom_filtertsearch_bind_dntsearch_bind_passwordtuser_search_base_dntuser_search_filtertuser_dntemplateR%sError enabling LDAP %s: %st	exceptionN(R3tenable_ldap_authenticationRRRRR!RRRRR t	solidfiretcommontApiServerErrorR&R1t
account_idR	t	tracebackt
format_exc(R4terror((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pytenable_ldap�s							%cC`s�|j|jjkrtS|j|jjkr2tS|j|jjkrKtS|j|jj	krdtS|j
|jjkr}tS|j|jj
kr�tS|j|jjkr�tS|j|jjkr�tS|j|jjkr�tS|j|jjkr�tStS(s�
        Check to see if the ldap config has been modified.
        :param ldap_config: The LDAP configuration
        :return: False if the config is the same as the playbook, True if it is not
        (Rtldap_configurationR9R+Rtserver_urisRR:RR;R!R<RR=RR>RR?RR@R RAR0(R4R8((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pytcheck_config�s*cC`s�t}|j�}|jdkr?|r?|jjr?t}q?n|jdkrf|j|�rft}n|r�|jjr{q�|jdkr�|j	�q�|jdkr�|j
j�q�n|jjd|�dS(NRRtchanged(
R0R7RRLtenabledR+RNR&t
check_modeRKR3tdisable_ldap_authenticationt	exit_json(R4ROR8((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pytapply�s	
(t__name__t
__module__R6R7RKRNRT(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pyR
ss
	+	
		cC`st�}|j�dS(N(R
RT(tv((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pytmain�s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRHtansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR't
has_sf_sdkR/tsolidfire.commonRDt	ExceptionR0tobjectR
RXRU(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_ldap.pyt<module>s(


@

z	

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