community.general.lvm_pv module – Manage LVM Physical Volumes
Note
This module is part of the community.general collection (version 11.2.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.lvm_pv
.
New in community.general 11.0.0
Synopsis
Creates, resizes or removes LVM Physical Volumes.
Parameters
Parameter |
Comments |
---|---|
Path to the block device to manage. |
|
Force the operation. When When Choices:
|
|
Control if the physical volume exists. Choices:
|
Notes
Note
Requires LVM2 utilities installed on the target system.
Device path must exist when creating a PV.
Examples
- name: Creating physical volume on /dev/sdb
community.general.lvm_pv:
device: /dev/sdb
- name: Creating and resizing (if needed) physical volume
community.general.lvm_pv:
device: /dev/sdb
resize: true
- name: Removing physical volume that is not part of any volume group
community.general.lvm_pv:
device: /dev/sdb
state: absent
- name: Force removing physical volume that is already part of a volume group
community.general.lvm_pv:
device: /dev/sdb
force: true
state: absent