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/_sf_account_manager.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont
deprecatedtstatust	communitytsupported_bysm

module: sf_account_manager
deprecated:
  removed_in: "2.11"
  why: This Module has been replaced
  alternative: please use M(na_elementsw_account)
short_description: Manage SolidFire accounts
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.3'
author: Sumit Kumar (@timuster) <[email protected]>
description:
- Create, destroy, or update accounts on SolidFire

options:

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

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

    new_name:
        description:
        - New name for the user account.

    initiator_secret:
        description:
        - CHAP secret to use for the initiator. Should be 12-16 characters long and impenetrable.
        - The CHAP initiator secrets must be unique and cannot be the same as the target CHAP secret.
        - If not specified, a random secret is created.

    target_secret:
        description:
        - CHAP secret to use for the target (mutual CHAP authentication).
        - Should be 12-16 characters long and impenetrable.
        - The CHAP target secrets must be unique and cannot be the same as the initiator CHAP secret.
        - If not specified, a random secret is created.

    attributes:
        description: List of Name/Value pairs in JSON object format.

    account_id:
        description:
        - The ID of the account to manage or update.

    status:
        description:
        - Status of the account.

s�
- name: Create Account
  sf_account_manager:
    hostname: "{{ solidfire_hostname }}"
    username: "{{ solidfire_username }}"
    password: "{{ solidfire_password }}"
    state: present
    name: TenantA

- name: Modify Account
  sf_account_manager:
    hostname: "{{ solidfire_hostname }}"
    username: "{{ solidfire_username }}"
    password: "{{ solidfire_password }}"
    state: present
    name: TenantA
    new_name: TenantA-Renamed

- name: Delete Account
  sf_account_manager:
    hostname: "{{ solidfire_hostname }}"
    username: "{{ solidfire_username }}"
    password: "{{ solidfire_password }}"
    state: absent
    name: TenantA-Renamed
s

N(t
AnsibleModule(t	to_nativetSolidFireAccountcB`s>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`s�tj�|_|jjtdtdtdddg�dtdtdd�d	tdtdd
dd�dtdtdddd�d
tdtdddt�dtdtdddt�dtdtdd�dtdtdd���td|jdt�|_	|j	j
}|d|_|d|_|d	|_
|d|_|d
|_|d|_|d|_|d|_ttkr�|j	jdd�ntjd|j	�|_dS(Ntstatetrequiredtchoicestpresenttabsenttnamettypetstrt
account_idtinttdefaulttnew_nametinitiator_secrettno_logt
target_secrett
attributestdictRt
argument_spectsupports_check_modetmsgs)Unable to import the SolidFire Python SDKtmodule(tnetapp_utilstontap_sf_host_argument_specRtupdateRtTruetFalsetNoneRRtparamsRRRRRRRRt
HAS_SF_SDKt	fail_jsontcreate_sf_connectiontsfe(tselftp((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pyt__init__ss2	







cC`st|jj�}x^|jD]S}|j|jkr|jdk	rY|j|jkri|Sql|j|_|SqqWdS(s�
            Return account object if found

            :return: Details about the account. None if not found.
            :rtype: dict
        N(R*t
list_accountstaccountstusernameRRR%(R+taccount_listtaccount((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pytget_account�sc	C`s�y5|jjd|jd|jd|jd|j�WnEtk
r|}|jjdd|jt	|�fdt
j��nXdS(NR0RRRRsError creating account %s: %s)t	exception(R*tadd_accountRRRRt	ExceptionRR(R	t	tracebackt
format_exc(R+te((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pytcreate_account�s		%cC`sfy|jjd|j�WnEtk
ra}|jjdd|jt|�fdtj��nXdS(NRRsError deleting account %s: %sR4(	R*tremove_accountRR6RR(R	R7R8(R+R9((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pytdelete_account�s
%c
C`s�yG|jjd|jd|jd|jd|jd|jd|j�WnEtk
r�}|j	j
dd|jt|�fd	tj
��nXdS(
NRR0RRRRRsError updating account %s: %sR4(R*tmodify_accountRRRRRRR6RR(R	R7R8(R+R9((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pytupdate_account�s				%c
C`s-t}t}t}|j�}|r�t}|jdkrBt}q�|jdkr�|jdk	r�|jdk	r�|j|jkr�t}t}q�|jdk	r�|jdk	r�|j|jkr�t}t}q�|jdk	r|jdk	r|j|jkrt}t}q�|j	dk	rM|j	dk	rM|j	|j	krMt}t}q�|j
dk	r�|j
dk	r�|j
|j
kr�t}t}q�q�n|jdkr�t}n|r|jjr�q|jdkr�|s�|j
�q|r|j�qq|jdkr|j�qn|jjd|�dS(NRRtchanged(R$R3R#RR0R%RRRRRRt
check_modeR:R>R<t	exit_json(R+R?taccount_existsR>taccount_detail((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pytapply�sT						
(t__name__t
__module__R-R3R:R<R>RD(((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pyR
qs	%		
		
cC`st�}|j�dS(N(R
RD(tv((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pytmains	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR7tansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR t
has_sf_sdkR'tobjectR
RHRE(((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/_sf_account_manager.pyt<module>s 


;�	

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