Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/system/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZd
�Z
dd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
author:
    - Alain Dejoux (@adejoux)
module: aix_lvol
short_description: Configure AIX LVM logical volumes
description:
  - This module creates, removes or resizes AIX logical volumes. Inspired by lvol module.
version_added: "2.4"
options:
  vg:
    description:
    - The volume group this logical volume is part of.
    type: str
    required: true
  lv:
    description:
    - The name of the logical volume.
    type: str
    required: true
  lv_type:
    description:
    - The type of the logical volume.
    type: str
    default: jfs2
  size:
    description:
    - The size of the logical volume with one of the [MGT] units.
    type: str
  copies:
    description:
    - The number of copies of the logical volume.
    - Maximum copies are 3.
    type: int
    default: 1
  policy:
    description:
    - Sets the interphysical volume allocation policy.
    - C(maximum) allocates logical partitions across the maximum number of physical volumes.
    - C(minimum) allocates logical partitions across the minimum number of physical volumes.
    type: str
    choices: [ maximum, minimum ]
    default: maximum
  state:
    description:
    - Control if the logical volume exists. If C(present) and the
      volume does not already exist then the C(size) option is required.
    type: str
    choices: [ absent, present ]
    default: present
  opts:
    description:
    - Free-form options to be passed to the mklv command.
    type: str
  pvs:
    description:
    - A list of physical volumes e.g. C(hdisk1,hdisk2).
    type: list
sy
- name: Create a logical volume of 512M
  aix_lvol:
    vg: testvg
    lv: testlv
    size: 512M

- name: Create a logical volume of 512M with disks hdisk1 and hdisk2
  aix_lvol:
    vg: testvg
    lv: test2lv
    size: 512M
    pvs: [ hdisk1, hdisk2 ]

- name: Create a logical volume of 512M mirrored
  aix_lvol:
    vg: testvg
    lv: test3lv
    size: 512M
    copies: 2

- name: Create a logical volume of 1G with a minimum placement policy
  aix_lvol:
    vg: rootvg
    lv: test4lv
    size: 1G
    policy: minimum

- name: Create a logical volume with special options like mirror pool
  aix_lvol:
    vg: testvg
    lv: testlv
    size: 512M
    opts: -p copy1=poolA -p copy2=poolB

- name: Extend the logical volume to 1200M
  aix_lvol:
    vg: testvg
    lv: test4lv
    size: 1200M

- name: Remove the logical volume
  aix_lvol:
    vg: testvg
    lv: testlv
    state: absent
s�
msg:
  type: str
  description: A friendly message describing the task result.
  returned: always
  sample: Logical volume testlv created.
N(t
AnsibleModulecC`sl|dj�}dddg}yd|j|�}Wn!tk
rY|jdd�nXt|d �|S(Ni����tMtGtTitmsgsNo valid size unit specified.(tuppertindext
ValueErrort	fail_jsontint(tmoduletsizetunittunitst
multiplier((sC/usr/lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pytconvert_size�s
icC`s=t|tt|�|��}||kr9||7}n|S(N(Rtroundtfloat(txtbasetnew_size((sC/usr/lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pytround_ppsize�s 
c	C`s8d}x�|j�D]�}tjd|�}|dk	r[|jd�}|jd�}qntjd|�}|dk	r�t|jd��}qntjd|�}|dk	r�t|jd��}qntjd|�}|dk	r|jd�}qqqW|sdS||}i|d6|d6|d	6|d
6S(Ns/LOGICAL VOLUME:\s+(\w+)\s+VOLUME GROUP:\s+(\w+)iisLPs:\s+(\d+).*PPssPP SIZE:\s+(\d+)sINTER-POLICY:\s+(\w+)tnametvgRtpolicy(tNonet
splitlinestretsearchtgroupR(	tdataRtlinetmatchRtlpstpp_sizeR R((sC/usr/lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pytparse_lv�s.

cC`sx�|j�D]�}tjd|�}|dk	rF|jd�}q
ntjd|�}|dk	rt|jd��}q
ntjd|�}|dk	r�t|jd��}q
ntjd|�}|dk	r
t|jd��}q
q
q
Wi|d6|d6|d6|d	6S(
NsVOLUME GROUP:\s+(\w+)isTOTAL PP.*\((\d+)sPP SIZE:\s+(\d+)sFREE PP.*\((\d+)RRtfreeR*(R"R#R$R!R%R(R&R'R(RRR*R,((sC/usr/lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pytparse_vg�s$
cC`s�tdtdtdddt�dtdddt�dtdddd	�d
tdd�dtdddd�d
tdddd�dtdddddddg�dtdddddddg�dtdddt���	dt�}|jd}|jd}|jd}|jd
}|jd}|jd
}|jd}|jd}|jd}	dj|	�}
|dkr�d}nd}|jr�d}nd}|jddt�}
|jddt�}|jd |
|f�\}}}|d!krK|dkr"|j	d"t
d#d$|�qK|jd#d$|d%|d&|d'|�nt|�}|dk	r�tt||�d(|d)�}n|jd ||f�\}}}|d!kr�|dkr�|j	d"t
d#d*|�q�nt
}t|�}|dkr&|r&|dkr&|jd#d+�q&n|dkr|dkr�||d,krs|jd#d-|d.|d,f�n|jd/dt�}d0||||||||||
f
}|j|�\}}}|d!kr�|j	d"td#d1|�q|jd#d2|d%|d&|d'|�q�n�|dkr�|jd3dt�}|jd4|||d.f�\}}}|d!kr�|j	d"td#d5|�q�|jd#d6|d%|d&|d'|�n
|d|krb|jd7dt�}|jd8||||d.f�\}}}|d!kr9|j	d"td#d9||f�qb|jd#d:|d%|d&|d'|�n||dkr�|jd#d;||df�n|s�|j	d"t
d#d<|�nt|�|d
kru|jd=dt�}d>|||||d
f}|j|�\}}}|d!krF|j	d"td#d?||f�q�|jd#d@||fd%|d&|d'|�nQ||d
kr�|jd#dA||d
f�n |j	d"t
d#dB||f�dS(CNt
argument_specRttypetstrtrequiredtlvtlv_typetdefaulttjfs2RtoptsttcopiesRitstatetpresenttchoicestabsentR tmaximumtminimumtpvstlisttsupports_check_modet Rtmsecho tlsvgtlslvs%s %sitchangedRsVolume group %s does not exist.trctoutterrRR*s!Logical Volume %s does not exist.sNo size given.R,s5Not enough free space in volume group %s: %s MB free.Rtmklvs+%s %s -t %s -y %s -c %s  -e %s %s %s %sM %ssLogical volume %s created.s"Creating logical volume %s failed.trmlvs%s %s -f %ssLogical volume %s deleted.s#Failed to remove logical volume %s.tchlvs%s %s -e %s %ss%Logical volume %s policy changed: %s.s*Failed to change logical volume %s policy.s2Logical volume %s already exist in volume group %ss Logical volume %s already exist.textendlvs%s %s %s %sMs(Logical volume %s size extended to %sMB.sUnable to resize %s to %sMB.s@No shrinking of Logical Volume %s permitted. Current size: %s MBs'Logical volume %s size is already %sMB.(RtdicttTrueR@tparamstjoint
check_modetget_bin_pathtrun_commandt	exit_jsontFalseRR-R!RRR+R(RRR2R3RR6R8R R9R?tpv_listt	lv_policyttest_opttlsvg_cmdtlslv_cmdRGtvg_infoRItthis_vgtlv_sizetlv_infoRFtthis_lvtmklv_cmdtcmdRHtrmlv_cmdtchlv_cmdtextendlv_cmd((sC/usr/lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pytmain�s�!!	








			")" %(,)),#)!#/!t__main__(t
__future__RRRR/t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR#tansible.module_utils.basicRRRR+R-Rft__name__(((sC/usr/lib/python2.7/site-packages/ansible/modules/system/aix_lvol.pyt<module>s 


<0				�

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