Skip to content

Instantly share code, notes, and snippets.

@aric49
Created July 5, 2019 18:24
Show Gist options
  • Select an option

  • Save aric49/dc659bc30e628ddf378d10d81ce42d17 to your computer and use it in GitHub Desktop.

Select an option

Save aric49/dc659bc30e628ddf378d10d81ce42d17 to your computer and use it in GitHub Desktop.
Provision LVM using Ansible
- hosts: all
become: true
tasks:
#Provisions PVs and everything!
- name: volume group creation
lvg:
vg: data_vg
pvs:
- /dev/nvme0n1
- /dev/nvme2n1
- /dev/nvme3n1
- /dev/nvme4n1
- /dev/nvme1n1
- /dev/nvme6n1
- name: logical volume creation
lvol:
vg: data_vg
lv: data_lv
size: 100%FREE
#Creates a file system
- name: filesystem
filesystem:
fstype: xfs
dev: /dev/data_vg/data_lv
#Automatically creates mountpoint and /etc/fstab entries
- name: mount new disk
mount:
name: /mnt/point
src: /dev/data_vg/data_lv
fstype: xfs
state: mounted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment