Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/remote_management/ucs/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
�Zd�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysI
---
module: ucs_disk_group_policy
short_description: Configures disk group policies on Cisco UCS Manager
description:
- Configures disk group policies on Cisco UCS Manager.
- Examples can be used with the L(UCS Platform Emulator,https://communities.cisco.com/ucspe).
extends_documentation_fragment: ucs
options:
  state:
    description:
    - Desired state of the disk group policy.
    - If C(present), will verify that the disk group policy is present and will create if needed.
    - If C(absent), will verify that the disk group policy is absent and will delete if needed.
    choices: [present, absent]
    default: present
  name:
    description:
    - The name of the disk group policy.
      This name can be between 1 and 16 alphanumeric characters.
    - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)."
    - You cannot change this name after the policy is created.
    required: yes
  description:
    description:
    - The user-defined description of the storage profile.
      Enter up to 256 characters.
      "You can use any characters or spaces except the following:"
      "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)."
    aliases: [ descr ]
  raid_level:
    description:
    - "The RAID level for the disk group policy. This can be one of the following:"
    - "stripe - UCS Manager shows RAID 0 Striped"
    - "mirror - RAID 1 Mirrored"
    - "mirror-stripe - RAID 10 Mirrored and Striped"
    - "stripe-parity - RAID 5 Striped Parity"
    - "stripe-dual-parity - RAID 6 Striped Dual Parity"
    - "stripe-parity-stripe - RAID 50 Striped Parity and Striped"
    - "stripe-dual-parity-stripe - RAID 60 Striped Dual Parity and Striped"
    choices: [stripe, mirror, mirror-stripe, stripe-parity, stripe-dual-parity, stripe-parity-stripe, stripe-dual-parity-stripe]
    default: stripe
  configuration_mode:
    description:
    - "Disk group configuration mode. Choose one of the following:"
    - "automatic - Automatically configures the disks in the disk group."
    - "manual - Enables you to manually configure the disks in the disk group."
    choices: [automatic, manual]
    default: automatic
  num_drives:
    description:
    - Specify the number of drives for the disk group.
    - This can be from 0 to 24.
    - Option only applies when configuration mode is automatic.
    default: 1
  drive_type:
    description:
    - Specify the drive type to use in the drive group.
    - "This can be one of the following:"
    - "unspecified — Selects the first available drive type, and applies that to all drives in the group."
    - "HDD — Hard disk drive"
    - "SSD — Solid state drive"
    - Option only applies when configuration mode is automatic.
    choices: [unspecified, HDD, SSD]
    default: unspecified
  num_ded_hot_spares:
    description:
    - Specify the number of hot spares for the disk group.
    - This can be from 0 to 24.
    - Option only applies when configuration mode is automatic.
    default: unspecified
  num_glob_hot_spares:
    description:
    - Specify the number of global hot spares for the disk group.
    - This can be from 0 to 24.
    - Option only applies when configuration mode is automatic.
    default: unspecified
  min_drive_size:
    description:
    - Specify the minimum drive size or unspecified to allow all drive sizes.
    - This can be from 0 to 10240 GB.
    - Option only applies when configuration mode is automatic.
    default: 'unspecified'
  use_remaining_disks:
    description:
    - Specifies whether you can use all the remaining disks in the disk group or not.
    - Option only applies when configuration mode is automatic.
    choices: ['yes', 'no']
    default: 'no'
  manual_disks:
    description:
    - List of manually configured disks.
    - Options are only used when you choose manual configuration_mode.
    suboptions:
      name:
        description:
        - The name of the local LUN.
        required: yes
      slot_num:
        description:
        - The slot number of the specific disk.
      role:
        description:
        - "The role of the disk. This can be one of the following:"
        - "normal - Normal"
        - "ded-hot-spare - Dedicated Hot Spare"
        - "glob-hot-spare - Glob Hot Spare"
      span_id:
        description:
        - The Span ID of the specific disk.
        default: 'unspecified'
      state:
        description:
        - If C(present), will verify disk slot is configured within policy.
          If C(absent), will verify disk slot is absent from policy.
        choices: [ present, absent ]
        default: present
  virtual_drive:
    description:
    - Configuration of virtual drive options.
    suboptions:
      access_policy:
        description:
        - Configure access policy to virtual drive.
        choices: [blocked, hidden, platform-default, read-only, read-write, transport-ready]
        default: platform-default
      drive_cache:
        description:
        - Configure drive caching.
        choices: [disable, enable, no-change, platform-default]
        default: platform-default
      io_policy:
        description:
        - Direct or Cached IO path.
        choices: [cached, direct, platform-default]
        default: platform-default
      read_policy:
        description:
        - Read access policy to virtual drive.
        choices: [normal, platform-default, read-ahead]
        default: platform-default
      strip_size:
        description:
        - Virtual drive strip size.
        choices: [ present, absent ]
        default: platform-default
      write_cache_policy:
        description:
        - Write back cache policy.
        choices: [always-write-back, platform-default, write-back-good-bbu, write-through]
        default: platform-default
  org_dn:
    description:
    - The distinguished name (dn) of the organization where the resource is assigned.
    default: org-root
requirements:
- ucsmsdk
author:
- Sindhu Sudhir (@sisudhir)
- David Soper (@dsoper2)
- CiscoUcs (@CiscoUcs)
- Brett Johnson (@sdbrett)
version_added: '2.8'
s�
- name: Configure Disk Group Policy
  ucs_disk_group_policy:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: DEE-DG
    raid_level: mirror
    configuration_mode: manual
    manual_disks:
    - slot_num: '1'
      role: normal
    - slot_num: '2'
      role: normal

- name: Remove Disk Group Policy
  ucs_disk_group_policy:
    name: DEE-DG
    hostname: 172.16.143.150
    username: admin
    password: password
    state: absent

- name: Remove Disk from Policy
  ucs_disk_group_policy:
    hostname: 172.16.143.150
    username: admin
    password: password
    name: DEE-DG
    description: Testing Ansible
    raid_level: stripe
    configuration_mode: manual
    manual_disks:
    - slot_num: '1'
      role: normal
    - slot_num: '2'
      role: normal
      state: absent
    virtual_drive:
      access_policy: platform-default
      io_policy: direct
      strip_size: 64KB
s
#
(t
AnsibleModule(t	UCSModuletucs_argument_speccC`sddlm}ddlm}ddlm}|js�y�|d|jdd|jdd|jd	d
|jd
�}|jddkr�|d|d
|jd
d|jdd|jdd|jdd|jdd|jd�n�x�|jdD]�}|ddkrN|d|d}|jj	|�}	|	ry|jj
|	�qyq�|d|d|dd|dd|d�q�W|jdr�t||�n|jj|t
�|jj�Wq�tk
r�}
dt|
�|jd<|j|j�q�Xnt
|jd<dS(Ni(tLstorageDiskGroupConfigPolicy(tLstorageDiskGroupQualifier(tLstorageLocalDiskConfigReftparent_mo_or_dntorg_dntnametdescrtdescriptiont
raid_leveltconfiguration_modet	automatict
num_drivest
drive_typetuse_remaining_diskstnum_ded_hot_sparestnum_glob_hot_sparestmin_drive_sizetmanual_diskststatetabsents/slot-tslot_numtroletspan_idt
virtual_drivessetup error: %s tmsgtchanged(t5ucsmsdk.mometa.lstorage.LstorageDiskGroupConfigPolicyRt2ucsmsdk.mometa.lstorage.LstorageDiskGroupQualifierRt2ucsmsdk.mometa.lstorage.LstorageLocalDiskConfigRefR
t
check_modetparamstlogin_handletquery_dnt	remove_mot_configure_virtual_drivetadd_motTruetcommitt	Exceptiontstrtresultt	fail_json(tucstmoduletdnRRR
tmotdisktchild_dntmo_1te((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pytconfigure_disk_policy�sL	










c	C`s�t}td|jd�}|jd|d<|j|�r�|jddkr�|d}|jj|�}|r�td|jd�}|jd|d<|jd	|d	<|jd
|d
<|jd|d<|jd|d<|j|�}q�n�x�|jd
D]�}|d|d}|jj|�}|r�|ddkrHt}q�td|d�}|d|d<|d|d<|j|�s�t}Pq�q�q�W|r�|jdr�t|||�}q�q�nt}|S(NRRRRRs/disk-group-qualRRRRRRRs/slot-RRRR R!R"(R/tdictR)tcheck_prop_matchR*R+tFalsetcheck_virtual_drive_props(	R5R6R8R7tprops_matchtkwargsR:R;R9((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pytcheck_disk_policy_propss@
	
cC`s0|d}|jj|�}|j|jd�S(Ns/virtual-drive-defR"(R*R+R?R)(R5R6R7R:R;((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pyRADs
cC`s+ddlm}|d||jd�dS(Ni(tLstorageVirtualDriveDefRR"(t/ucsmsdk.mometa.lstorage.LstorageVirtualDriveDefRER)(R6R8RE((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pyR-JscC`stdtddddddddd	d
dg�dtdddddd
dddg�dtddddddddg�dtddddddddg�dtddddddddddddddg	�dtdddddd dd!d"g��S(#Nt
access_policyttypeR2tdefaultsplatform-defaulttchoicestblockedthiddens	read-onlys
read-writestransport-readytdrive_cachetdisabletenables	no-changet	io_policytcachedtdirecttread_policytnormals
read-aheadt
strip_sizet1024KBt128KBt16KBt256KBt32KBt512KBt64KBt8KBtwrite_cache_policysalways-write-backswrite-back-good-bbus
write-through(R>(((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pyt_virtual_drive_argument_specOs 	c"C`stdtdddt�dtddddddd	d
g�dtdddd�d
tdddddddg��}t}|jdtdddd�dtdddt�dtddddgdd�dtddddddddddddg�dtdddd �d!tdddd"dd"d#g�d$tdddd�d%tdddd�d&tddddddd'd(g�d)tdddd*dd+d*g�d,tdddd�d-tdd.d/d0d1|�d
tdddddddg�d2tdd0d1t���t|d3t�}t|�}t|jd4<t}|j	dd5|j	d}|j
j|�}|r�|j	d
dkr�|js�|j
j
|�|j
j�nt|jd4<q�t||||�}n|j	d
dkr|rt|||�n|j|j�dS(6NRRHR2trequiredR RIRTRJs
ded-hot-sparesglob-hot-spareR!tunspecifiedRtpresentRRsorg-rootRRtaliasesRtRtstripetmirrors
mirror-stripes
stripe-paritysstripe-dual-paritysstripe-parity-stripesstripe-dual-parity-stripeRt1RRtmanualRRRtHDDtSSDRtnotyesRRtlisttelementsR>toptionsR"tsupports_check_modeR$s/disk-group-config-(R>R/R
tupdateR_RR	R@R3R)R*R+R(R,R0RDR=t	exit_json(tmanual_diskt
argument_specR6R5RBR7R8((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pytmaincs`$$	!$!!	
	t__main__N(t
__future__RRRRHt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt*ansible.module_utils.remote_management.ucsR	R
R=RDRAR-R_Rut__name__(((s_/usr/lib/python2.7/site-packages/ansible/modules/remote_management/ucs/ucs_disk_group_policy.pyt<module>s"


�,	3	*				C

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