ansible.builtin.lvg (v2.4.6.0-1) — module

Configure LVM volume groups

| "added in version" 1.1 of ansible.builtin"

Authors: Alexander Bulimov (@abulimov)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

This module creates, removes or resizes volume groups.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a volume group on top of /dev/sda1 with physical extent size = 32MB.
- lvg:
    vg: vg.services
    pvs: /dev/sda1
    pesize: 32
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create or resize a volume group on top of /dev/sdb1 and /dev/sdc5.
# If, for example, we already have VG vg.services on top of /dev/sdb1,
# this VG will be extended by /dev/sdc5.  Or if vg.services was created on
# top of /dev/sda5, we first extend it with /dev/sdb1 and /dev/sdc5,
# and then reduce by /dev/sda5.
- lvg:
    vg: vg.services
    pvs: /dev/sdb1,/dev/sdc5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove a volume group with name vg.services.
- lvg:
    vg: vg.services
    state: absent

Inputs

    
vg:
    description:
    - The name of the volume group.
    required: true

pvs:
    description:
    - List of comma-separated devices to use as physical devices in this volume group.
      Required when creating or resizing volume group.
    - The module will take care of running pvcreate if needed.
    required: false

force:
    choices:
    - 'yes'
    - 'no'
    default: 'no'
    description:
    - If yes, allows to remove volume group with logical volumes.
    required: false

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Control if the volume group exists.
    required: false

pesize:
    default: 4
    description:
    - The size of the physical extent in megabytes. Must be a power of 2.
    required: false

pv_options:
    default: null
    description:
    - Additional options to pass to C(pvcreate) when creating the volume group.
    required: false
    version_added: '2.4'
    version_added_collection: ansible.builtin

vg_options:
    default: null
    description:
    - Additional options to pass to C(vgcreate) when creating the volume group.
    required: false
    version_added: '1.6'
    version_added_collection: ansible.builtin