Documentation

    lvm_snapshot

    Manage LVM snapshots for backup and rollback operations.

    Attributes

    check_mode:
      support: full
    

    Parameters

    Parameter Required Type Values Description
    vg true string   Volume group name.
    lv true string   Logical volume name to snapshot.
    snapshot_name true string   Name for the snapshot.
    size   string   Size of the snapshot (e.g., 5G, 512M). Required when state is present.
    state   string present
    absent
    Whether the snapshot should exist or not. [default: "present"]

    Example

    - name: Create a snapshot of root logical volume
      lvm_snapshot:
        vg: vg0
        lv: root
        snapshot_name: root_backup
        size: 5G
    
    - name: Remove a snapshot
      lvm_snapshot:
        vg: vg0
        lv: root
        snapshot_name: root_backup
        state: absent