Anons79 Mini Shell

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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	dZ
eZyddl
mZWnek
r�eZnXdd
lmZddlmZmZd�Zd�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: purefb_ds
version_added: '2.8'
short_description: Configure FlashBlade Directory Service
description:
- Create or erase directory services configurations. There is no facility
  to SSL certificates at this time. Use the FlashBlade GUI for this
  additional configuration work.
- To modify an existing directory service configuration you must first delete
  an existing configuration and then recreate with new settings.
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
  state:
    description:
    - Create or delete directory service configuration
    default: present
    type: str
    choices: [ absent, present ]
  dstype:
    description:
    - The type of directory service to work on
    choices: [ management, nfs, smb ]
    type: str
  enable:
    description:
    - Whether to enable or disable directory service support.
    default: false
    type: bool
  uri:
    description:
    - A list of up to 30 URIs of the directory servers. Each URI must include
      the scheme ldap:// or ldaps:// (for LDAP over SSL), a hostname, and a
      domain name or IP address. For example, ldap://ad.company.com configures
      the directory service with the hostname "ad" in the domain "company.com"
      while specifying the unencrypted LDAP protocol.
    type: list
  base_dn:
    description:
    - Sets the base of the Distinguished Name (DN) of the directory service
      groups. The base should consist of only Domain Components (DCs). The
      base_dn will populate with a default value when a URI is entered by
      parsing domain components from the URI. The base DN should specify DC=
      for each domain component and multiple DCs should be separated by commas.
    required: true
    type: str
  bind_password:
    description:
    - Sets the password of the bind_user user name account.
    type: str
  bind_user:
    description:
    - Sets the user name that can be used to bind to and query the directory.
    - For Active Directory, enter the username - often referred to as
      sAMAccountName or User Logon Name - of the account that is used to
      perform directory lookups.
    - For OpenLDAP, enter the full DN of the user.
    type: str
  nis_servers:
    description:
    - A list of up to 30 IP addresses or FQDNs for NIS servers.
    - This cannot be used in conjunction with LDAP configurations.
    type: list
    version_added: 2.9
  nis_domain:
    description:
    - The NIS domain to search
    - This cannot be used in conjunction with LDAP configurations.
    type: str
    version_added: 2.9
  join_ou:
    description:
      - The optional organizational unit (OU) where the machine account
        for the directory service will be created.
    type: str
    version_added: 2.9
extends_documentation_fragment:
- purestorage.fb
sq
- name: Delete existing management directory service
  purefb_ds:
    dstype: management
    state: absent
    fb_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create NFS directory service (disabled)
  purefb_ds:
    dstype: nfs
    uri: "ldaps://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    fb_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Enable existing SMB directory service
  purefb_ds:
    dstypr: smb
    enable: true
    fb_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Disable existing management directory service
  purefb_ds:
    dstype: management
    enable: false
    fb_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create NFS directory service (enabled)
  purefb_ds:
    dstype: nfs
    enable: true
    uri: "ldaps://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    fb_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
t
s1.7(tDirectoryService(t
AnsibleModule(t	get_bladetpurefb_argument_speccC`st}|jd|�dS(sUpdate Directory ServicetchangedN(tFalset	exit_json(tmoduletbladeR
((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pyt	update_ds�scC`s�t}|js|y6|jjd|jdgdtdt��t}Wq|tk
rx|jddj|jd��q|Xn|j	d|�dS(	sEnable Directory Servicetnamestdstypetdirectory_servicetenabledtmsgs8Enable {0} Directory Service failed: Check ConfigurationR
N(
tTruet
check_modetdirectory_servicestupdate_directory_servicestparamsR	t	Exceptiont	fail_jsontformatR(RRR
((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pyt	enable_ds�s	

'cC`s�t}|jsvy0|jjd|jdgdtdt��Wqvtk
rr|jddj	|jd��qvXn|j
d|�dS(	sDisable Directory ServiceRRRRRs$Disable {0} Directory Service failedR
N(RRRRRR	RRRRR(RRR
((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pyt
disable_ds�s	
'c
C`st}|js�|jjd|jdg�}y�|jddkr�|jdjr�tddgddddd	dd
t�}q�t}n|jddkr�|jdjr�idd6}tddgddddd	dd|d
t�}q�t}n�|jdd
kr�|jdjrFtddgddddd	dd
t�}q�|jdj	j
r�igd6gd6}td
|d
t�}q�t}n|r�|jjd|jdgd|�nWq�tk
r�|j
ddj|jd��q�Xn|jd|�dS(sDelete Directory ServiceRRt
managementituristtbase_dnt	bind_usert
bind_passwordRtsmbtjoin_outnfstnis_domainstnis_serversRRs#Delete {0} Directory Service failedR
N(RRRtlist_directory_servicesRtitemsR#R	RR*R+RRRRR(RRR
tdirservtdir_servicet	smb_attrst	nfs_attrs((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pyt	delete_ds�sR		
	

	
'cC`s�t}|jsty.|jddkr�|jdr�td|jddd!d|jdd|jdd	|jd	d
|jd�}q|jdd
j|jd��np|jddkrZ|jdr7i|jdd6}td|jddd!d|jdd|jdd	|jd	d|d
|jd�}q|jdd
j|jd��n�|jddkr|jdr�i|jdgd6|jddd!d6}td|d
|jd�}qtd|jddd!d|jdd|jdd	|jd	d
|jd�}n|jjd|jdgd|�Wqttk
rp|jddj|jd��qtXn|j	d|�dS(sCreate Directory ServiceRR"turiR#iiR%R&R'RtenableRs@URI and associated params must be specified to create dstype {0}R(R)R*t
nis_domainR+R,RRs8Create {0} Directory Service failed: Check configurationR
N(
RRRR	RRRRRR(RRR
R0R1R2((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pyt	create_ds�sJ	



#



#




'c
C`s�t�}|jtdtdd�dtdtddddd	d
g�dtdddd
ddd
g�dtdddt�dtdddt�dtdd�dtdd�dtdd�dtdd�dtdd��
�ddddgddgddgg}ddgg}t|d|d|dt�}tsO|jdd�n|jd}t	|�}|j
j�j}t}|j
jd|jdg�}|jdj}	|jdjdk	r�t}n|jds�|jdrt|kr|jdd�nt}
t}xPtdt|jdj��D]/}d |jdj|j�kr3t}
q3q3W|jdr�xMtdt|jd��D],}d |jd|j�kr�t}q�q�Wn|jdr�|
s�|jdr|r|jds|jdr|jdd!�qn|dkr6t||�n�|r_|jdr_|	r_t||�n�|r�|jdr�|	r�t||�nj|r�|jdr�|	r�t||�t||�n3|r�|d
kr�t||�n|jd"t�dS(#NR4ttypetlistRtrequiredtstrtchoicesR"R*R(tstatetdefaulttpresenttabsentR5tboolR'tno_logR&R%R)R6R,trequired_togethertmutually_exclusivetsupports_check_modeRs)purity_fb sdk is required for this moduleRis\NFS or SMB directory service attributes are not supported in your FlashBlade Purity version.tldaps6NIS configuration not supported in an LDAP environmentR
(RtupdatetdictRRR
t
HAS_PURITY_FBRRRtapi_versiont
list_versionstversionsRR-R.RR%tNonetNIS_API_VERSIONtrangetlenR#tlowerR3RR!R R7R(
t
argument_specRCRDRR=RRJt
ds_configuredR/t
ds_enabledtldap_uritset_ldapR4((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pytmainsr	$!			
	&& 

#
t__main__N(t
__future__RRRR8t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRNRRIt	purity_fbR	tImportErrorRtansible.module_utils.basicR
tansible.module_utils.pureRRRR R!R3R7RWt__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.pyt<module>s.


Q,

		
		0	,	B

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