Author: | Jeroen Hoekx |
---|
parameter | required | default | choices | comments |
---|---|---|---|---|
force | no | no |
|
Shrink or remove operations of volumes requires this switch. Ensures that that filesystems get never corrupted/destroyed by mistake. (added in Ansible 1.5) |
lv | yes | The name of the logical volume. | ||
size | no | The size of the logical volume, according to lvcreate(8) --size, by default in megabytes or optionally with one of [bBsSkKmMgGtTpPeE] units; or according to lvcreate(8) --extents as a percentage of [VG|PVS|FREE]; resizing is not supported with percentages. | ||
state | no | present |
|
Control if the logical volume exists. |
vg | yes | The volume group this logical volume is part of. |
# Create a logical volume of 512m.
- lvol: vg=firefly lv=test size=512
# Create a logical volume of 512g.
- lvol: vg=firefly lv=test size=512g
# Create a logical volume the size of all remaining space in the volume group
- lvol: vg=firefly lv=test size=100%FREE
# Extend the logical volume to 1024m.
- lvol: vg=firefly lv=test size=1024
# Reduce the logical volume to 512m
- lvol: vg=firefly lv=test size=512 force=yes
# Remove the logical volume.
- lvol: vg=firefly lv=test state=absent force=yes
Note
Filesystems on top of the volume are not resized.