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/purefa_ds.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
Zd�Zd�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: purefa_ds
version_added: '2.6'
short_description: Configure FlashArray Directory Service
description:
- Set or erase configuration for the directory service. There is no facility
  to SSL certificates at this time. Use the FlashArray 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:
    type: str
    description:
    - Create or delete directory service configuration
    default: present
    choices: [ absent, present ]
  enable:
    description:
    - Whether to enable or disable directory service support.
    default: false
    type: bool
  uri:
    type: list
    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.
  base_dn:
    type: str
    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
  bind_password:
    type: str
    description:
    - Sets the password of the bind_user user name account.
  bind_user:
    type: str
    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.
  group_base:
    type: str
    description:
    - Specifies where the configured groups are located in the directory
      tree. This field consists of Organizational Units (OUs) that combine
      with the base DN attribute and the configured group CNs to complete
      the full Distinguished Name of the groups. The group base should
      specify OU= for each OU and multiple OUs should be separated by commas.
      The order of OUs is important and should get larger in scope from left
      to right. Each OU should not exceed 64 characters in length.
    - Not Supported from Purity 5.2.0 or higher. Use I(purefa_dsrole) module.
  ro_group:
    type: str
    description:
    - Sets the common Name (CN) of the configured directory service group
      containing users with read-only privileges on the FlashArray. This
      name should be just the Common Name of the group without the CN=
      specifier. Common Names should not exceed 64 characters in length.
    - Not Supported from Purity 5.2.0 or higher. Use I(purefa_dsrole) module.
  sa_group:
    type: str
    description:
    - Sets the common Name (CN) of the configured directory service group
      containing administrators with storage-related privileges on the
      FlashArray. This name should be just the Common Name of the group
      without the CN= specifier. Common Names should not exceed 64
      characters in length.
    - Not Supported from Purity 5.2.0 or higher. Use I(purefa_dsrole) module.
  aa_group:
    type: str
    description:
    - Sets the common Name (CN) of the directory service group containing
      administrators with full privileges when managing the FlashArray.
      The name should be just the Common Name of the group without the
      CN= specifier. Common Names should not exceed 64 characters in length.
    - Not Supported from Purity 5.2.0 or higher. Use I(purefa_dsrole) module.
extends_documentation_fragment:
- purestorage.fa
s5
- name: Delete existing directory service
  purefa_ds:
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create directory service (disabled) - Pre-5.2.0
  purefa_ds:
    uri: "ldap://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    group_base: "OU=Pure-Admin"
    ro_group: PureReadOnly
    sa_group: PureStorage
    aa_group: PureAdmin
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create directory service (disabled) - 5.2.0 or higher
  purefa_ds:
    uri: "ldap://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Enable existing directory service
  purefa_ds:
    enable: true
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Disable existing directory service
  purefa_ds:
    enable: false
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create directory service (enabled) - Pre-5.2.0
  purefa_ds:
    enable: true
    uri: "ldap://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    group_base: "OU=Pure-Admin"
    ro_group: PureReadOnly
    sa_group: PureStorage
    aa_group: PureAdmin
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Create directory service (enabled) - 5.2.0 or higher
  purefa_ds:
    enable: true
    uri: "ldap://lab.purestorage.com"
    base_dn: "DC=lab,DC=purestorage,DC=com"
    bind_user: Administrator
    bind_password: password
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
t
(t
AnsibleModule(t
get_systemtpurefa_argument_specs1.16cC`st}|jd|�dS(sUpdate Directory ServicetchangedN(tFalset	exit_json(tmoduletarrayR((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pyt	update_ds�scC`sRt}y|j�t}Wn!tk
r=|jdd�nX|jd|�dS(sEnable Directory Servicetmsgs4Enable Directory Service failed: Check ConfigurationRN(R
tenable_directory_servicetTruet	Exceptiont	fail_jsonR(RRR((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pyt	enable_ds�s


cC`sRt}y|j�t}Wn!tk
r=|jdd�nX|jd|�dS(sDisable Directory ServiceRs Disable Directory Service failedRN(R
tdisable_directory_serviceRRRR(RRR((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pyt
disable_ds�s


cC`s�t}y�|j�}|jdt�t|kre|jddgdddddddd�t}nI|jddgddddddddd	dd
ddddd�	t}Wn!tk
r�|jdd
�nX|jd|�dS(sDelete Directory Servicetenabledturittbase_dnt	bind_usert
bind_passwordtcertificatet
group_basetreadonly_grouptstorage_admin_grouptarray_admin_groupRsDelete Directory Service failedRN(R
t_list_available_rest_versionstset_directory_servicetDS_ROLE_REQUIRED_API_VERSIONRRRR(RRRtapi_version((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pyt	delete_ds�s0	

cC`s�t}|j�}t|kr�|jds>|jdd�ny_|jd|jdd|jdd|jdd|jd�|jd|jd	�t}Wq�tk
r�|jdd
�q�Xn�|jd|jd|jd
g}t|�r
|jdd�ny�|jd|jdd|jdd|jdd|jdd|jdd|jdd|jdd|jd
�|jd|jd	�t}Wn!tk
r�|jdd
�nX|j	d|�dS(sCreate Directory ServicetroleRs$At least one role must be configuredRRRRRtenables4Create Directory Service failed: Check configurationtro_grouptsa_grouptaa_groups%At least one group must be configuredR!R"R#R$RN(
R
R%R'tparamsRR&RRtallR(RRRR(tgroups_rule((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pyt	create_ds�sB












cC`st�}|jtdtdd�dtdddddd	dg�d
tdddt�dtddd
t�dtdd�dtdd�dtdd�dtdd�dtdd�dtdd��
�dddddgg}t|d|dt�}|jd}t|�}t}|j�}|d}|drEt}n|d	krg|rgt	||�n�|r�|jd
r�|r�t
||�n�|r�|jd
r�|r�t||�n]|r�|jd
r�|r�t||�n3|r|dkrt
||�n|jdt�dS(NRttypetlisttstatetstrtdefaulttpresenttchoicestabsentR+tboolRtno_logRRR!R,R-R.trequired_togethertsupports_check_modeRR(RtupdatetdictR
RR	R/R
tget_directory_serviceR)RRRR2R(t
argument_specR=RR5Rt	ds_existstdirservt
ds_enabled((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pytmainsF	!			


	t__main__N(t
__future__RRRR3t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	tansible.module_utils.pureR
RR'RRRR)R2RFt__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefa_ds.pyt<module>s$


^B					'	,

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