Role to manage LVM Groups/Logical Volumes. Can be used to create, extend or resize LVM Groups and volumes.
Devices/disks to be part of the LVM setup must be identified prior to using this role. Ensure that you select the correct devices/disks.
lvm_groups
is a list containing vgs.
vgname
: uniq namedisks
: add disks/partitions to vg (comma separated)create
: boolean (true => creates, false => deletes)lvnames
: lv list (see bellow)
lvname
: uniq namesize
: define size of lvol (ex: "10G", "512M"...)create
: defines if lvol should exist or be removed...true or falsefilesystem
: defines filesystem to format lvol asmount
: defines if filesystem should be mountedmount_point
: defines mountpointmount_options
: defines mount options (comma separated)
None
- hosts: servers
vars:
- vgname: misc-vg
disks: /dev/sda5,/dev/sdc,/dev/sdd
create: true
lvnames:
- lvname: swap_1
size: 5g
create: true
filesystem:
mount: false
- lvname: mysql
size: 40g
create: true
filesystem: ext4
mount: true
mount_point: /var/lib/mysql
mount_options: 'defaults,noatime'
# VG whitout LV
- vgname: test-vg
disks: /dev/sdb
create: true
lvnames: []
roles:
- HanXHX.lvm
BSD
If this code helped you, or if you’ve used them for your projects, feel free to buy me some 🍻
- Bitcoin:
1BQwhBeszzWbUTyK4aUyq3SRg7rBSHcEQn
- Ethereum:
63abe6b2648fd892816d87a31e3d9d4365a737b5
- Litecoin:
LeNDw34zQLX84VvhCGADNvHMEgb5QyFXyD
- Monero:
45wbf7VdQAZS5EWUrPhen7Wo4hy7Pa7c7ZBdaWQSRowtd3CZ5vpVw5nTPphTuqVQrnYZC72FXDYyfP31uJmfSQ6qRXFy3bQ
No crypto-currency? ⭐ the project is also a way of saying thank you! 😎
- Twitter: @hanxhx_