Forge Home

lvmconf

This module provides a provider to manages lvm.conf and a class to manage standard lvm scenarios including HA LVM.

4,782 downloads

222 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Jul 3rd 2023
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet > 6.0.0 < 9.0.0
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'arden-lvmconf', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add arden-lvmconf
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install arden-lvmconf --version 0.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

arden/lvmconf — version 0.1.1 Jul 3rd 2023

lvmconf

pipeline status Version coverage report

Table of Contents

  1. Description
  2. Setup - The basics of getting started with lvmconf
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

The lvmconf module delivers two main sets of functionality:

  1. A resource type for directly managing entries in lvm.conf called lvm_config.
  2. Pre-built logic to emulate the behavior of the lvmconf used to configure a system for HA LVM.

Setup

What lvmconf affects

1 - Packages

When enabled lvmconf will attempt to install the lvm2 package. Note that hiera defaults exist for RedHat 7 family operating systems, however, other operating systems will need to have the package_name parameter specified.

2 - lvm config

This class includes a provider for manipulating entries in /etc/lvm/lvm.conf using the lvmconfig command. Depending on the mode selected in the main class several configuration directives will be updated automatically. Currently this is limited to the following:

  • global/use_lvmetad - Controls the use of the LVM metadata daemon. When HA LVM is configured this must be disabled
  • global/locking_type - Controls the locking method used by LVM. This is needs to be set to standard locking for both halvm and standard modes of operation.

When halvm is enabled it is also important to configure the activation/volume_list parameter. This provides a white-list of volume groups which are safe for LVM to automatically import. Obviously any volumes which are part of an HA LVM scenario should be excluded from this list.

2 - Services

The state of the following services is managed automatically when mode is changed:

  • metad - the lvm metadata daemon (lvmetad). In a standard system without HA LVM this daemon is used to accelerate lvm query commands by caching states in memory. This must be disabled when used with HA LVM

Additionally, if enabled, this class can automatically regenerate the initramfs to incorporate the changes to lvm.conf.

Beginning with lvmconf

On a RedHat 7 based operating system enabling standard configuration can be performed via the following simple call:

class { 'lvmconf':
  manage_package => true,
  mode           => 'standard',
}

Usage

The following examples assume a RedHat 7 based operating system. If a different operating system is used which does not have module hiera data additional parameters will need to be specified.

Enabling HA LVM

class { 'lvmconf':
  mode             => 'halvm'
  manage_initramfs => true,
  local_vgs        => [ 'rootvg' ],
}

Alternatively the same configuration can be performed via hiera.

lvmconf::mode: 'halvm'
lvmconf::manage_initramfs: true
lvmconf::local_vgs:
  - 'rootvg'
include lvmconf

Enabling Standard LVM

class { 'lvmconf':
  mode             => 'standard'
  manage_initramfs => true,
}

Alternatively the same configuration can be performed via hiera.

lvmconf::mode: 'standard'
lvmconf::manage_initramfs: true
include lvmconf

Limitations

  • Enabling / disabling clvmd or cmirrord is currently not supported by this module.
  • Initramfs updates are limited to dracut, however, other generators such as genkernel likely could be added.
  • When lvm.conf parameters are modified there is no way to automatically reset them to default values. Such changes must be carried out directly on the target nodes.

Development

See the contributing guide.

Contributors

Check out the contributor list.