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_admin_users.pyc

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

module: na_elementsw_admin_users

short_description: NetApp Element Software Manage Admin Users
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Create, destroy, or update admin users on SolidFire

options:

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

    element_username:
        description:
        - Unique username for this account. (May be 1 to 64 characters in length).
        required: true

    element_password:
        description:
        - The password for the new admin account. Setting the password attribute will always reset your password, even if the password is the same

    acceptEula:
        description:
        - Boolean, true for accepting Eula, False Eula
        type: bool

    access:
        description:
        - A list of type the admin has access to
s�
    - name: Add admin user
      na_elementsw_admin_users:
        state: present
        username: "{{ admin_user_name }}"
        password: "{{ admin_password }}"
        hostname: "{{ hostname }}"
        element_username: carchi8py
        element_password: carchi8py
        acceptEula: True
        access: accounts,drives

    - name: modify admin user
      na_elementsw_admin_users:
        state: present
        username: "{{ admin_user_name }}"
        password: "{{ admin_password }}"
        hostname: "{{ hostname }}"
        element_username: carchi8py
        element_password: carchi8py12
        acceptEula: True
        access: accounts,drives,nodes

    - name: delete admin user
      na_elementsw_admin_users:
        state: absent
        username: "{{ admin_user_name }}"
        password: "{{ admin_password }}"
        hostname: "{{ hostname }}"
        element_username: carchi8py
s

N(t
AnsibleModule(t	to_native(tNaElementSWModuletNetAppElementSWAdminUsercB`sMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(sF
    Class to set, modify and delete admin users on ElementSW box
    cC`sgtj�|_|jjtdtdtdddg�dtdtdd�d	tdtddd
t�dtdtdd�d
tdtdd���td|jdt�|_|jj	}|d|_
|d|_|d	|_|d|_
|d
|_ttkr!|jjdd�ntjd|j�|_t|j�|_|jjdd�|_dS(s@
        Initialize the NetAppElementSWAdminUser class.
        tstatetrequiredtchoicestpresenttabsenttelement_usernamettypetstrtelement_passwordtno_logt
acceptEulatbooltaccesstlistt
argument_spectsupports_check_modetmsgs)Unable to import the SolidFire Python SDKtmoduletsourcetna_elementsw_admin_usersN(tnetapp_utilstontap_sf_host_argument_specRtupdatetdicttTruetFalseRRtparamsRRRRRt
HAS_SF_SDKt	fail_jsontcreate_sf_connectiontsfeR
telementsw_helpertset_element_attributest
attributes(tselftparam((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pyt__init__js*	




cC`s=|jj�}x'|jD]}|j|jkrtSqWtS(s�
        Checks to see if an admin user exists or not
        :return: True if the user exist, False if it dose not exist
        (R*tlist_cluster_adminstcluster_adminstusernameRR$R%(R.tadmins_listtadmin((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytdoes_admin_user_exist�s
cC`s=|jj�}x'|jD]}|j|jkr|SqWdS(sR
        Get the admin user object
        :return: the admin user object
        N(R*R1R2R3RtNone(R.R4R5((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytget_admin_user�s
c
C`s�t}|j�}|jdk	ret|j�dkrex,|jD]}||jkr@t}q@q@Wn|r�|jjd|jd|jd|j	d|j
�n|S(s�
        Modify a admin user. If a password is set the user will be modified as there is no way to
        compare a new password with an existing one
        :return: if a user was modified or not
        itcluster_admin_idRtpasswordR-N(R%R8RR7tlenR$R*tmodify_cluster_adminR9RR-(R.tchangedt
admin_userR((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytmodify_admin_user�s$		
cC`s>|jjd|jd|jd|jd|jd|j�dS(sX
        Add's a new admin user to the element cluster
        :return: nothing
        R3R:Rtaccept_eulaR-N(R*tadd_cluster_adminRRRRR-(R.((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytadd_admin_user�s
			cC`s&|j�}|jjd|j�dS(sb
        Deletes an existing admin user from the element cluster
        :return: nothing
        R9N(R8R*tremove_cluster_adminR9(R.R>((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytdelete_admin_user�scC`syt}|jdkrC|j�r0|j�}qb|j�t}n|j�rb|j�t}n|jjd|�dS(sg
        determines which method to call to set, delete or modify admin users
        :return:
        RR=N(	R%RR6R?RBR$RDRt	exit_json(R.R=((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytapply�s
	
	(
t__name__t
__module__t__doc__R0R6R8R?RBRDRF(((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pyRes	$					cC`st�}|j�dS(N(RRF(tv((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pytmain�s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNt	tracebacktansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR t,ansible.module_utils.netapp_elementsw_moduleR
t
has_sf_sdkR'tobjectRRKRG(((s[/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_admin_users.pyt<module>s"


( z	

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