Skip to content

OsgiliathEnterprise/ansible-volumes

Repository files navigation

Volumes

  • Galaxy: Ansible Galaxy
  • Lint & requirements: Molecule
  • Tests: Build Status
  • Chat: Join the chat at https://gitter.im/OsgiliathEnterprise/platform

This role is an extension of the most used lvm cookbook. It add the ability to create thinpools and their associated metadata

Role Variables

In addition to the usual variables, you can declare some more in order to configure thinpools

---
lvmetanames:
  ...
  metadata: <another lvname> # declares the metadata logical volume 
---
lvmetanames:
  ...
  autoextendtreshold: <number> # threshold of the autoextend profile
  autoextendpercent: <number> # percentage of the autoextend profile

Full example

---
  vars:
    lvm_groups:
      - vgname: myvg
        disks:
          - /dev/sdb1
        create: true
        lvnames:
          - lvname: notathinpool # original role
            size: 40%VG
            opts: "" 
            create: true
            filesystem: xfs
            mntp: /var/stuff
            mount: true
        lvmetanames:
          - lvname: thinpool
            size: 40%VG
            opts: "--wipesignatures y"
            create: true
            metadata: myvg/thinpoolmeta
            autoextendtreshold: 80
            autoextendpercent: 20
            filesystem: xfs
            mntp: /var/lib/docker
            mount: true
          - lvname: thinpoolmeta
            size: 10%VG
            opts: "--wipesignatures y"
            create: true
    manage_lvm: true

Also configures NFS server, but only if the machine is protected by Kerberos (see tcharl.ansible_securehost in order to configure it)

Dependencies

As said, mrlesmithjr.ansible-manage-lvm

Example Playbook

See the vars declared on the molecule test, as well as their impact

License

Apache-2

Author Information