Created
July 5, 2019 18:24
-
-
Save aric49/dc659bc30e628ddf378d10d81ce42d17 to your computer and use it in GitHub Desktop.
Provision LVM using Ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - 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