Nosmoht / ansible-role-lvm

Ansible role to install LVM and configure volume groups and logical volumes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lvm

Introduction

Manage logical volumes

Requirements

  • Ansible >= 2.0

Variables

Name Description Default
lvm_package_name Package name depends on ansible_os_family and ansible_distribution_major_version
lvm_package_state Package state present
lvm_volume_groups List of volume groups to ensure []
lvm_logical_volumes List of volumes definitions to ensure []

Usage

Ensure volume group datavg exists and located on device /dev/sdb, and a logical volume named docker with a size of 32G. In addition make sure that the volume is formated as btrfs filesystem and is mounted in /var/lib/docker.

---
- hosts: servers
  vars:
    lvm_volume_groups:
    - vg: datavg
      pvs: /dev/sdb
    lvm_logical_volumes:
    - vg: datavg
      name: docker
      size: 32G
      fstype: btrfs
      mount_point: /var/lib/docker
  roles:
  - role: lvm

About

Ansible role to install LVM and configure volume groups and logical volumes