datavol: Support creating btrfs subvolumes
Set the `btrfs_subvolumes` variable to an array of objects with `name` and `device` properties to create btrfs subvolumes.
This commit is contained in:
15
datavol.yml
15
datavol.yml
@@ -29,6 +29,21 @@
|
||||
tags:
|
||||
- mkfs
|
||||
|
||||
- name: ensure btrfs subvolumes exist
|
||||
community.general.btrfs_subvolume:
|
||||
name: '{{ item.name }}'
|
||||
filesystem_device: '{{ item.device }}'
|
||||
automount: true
|
||||
loop: '{{ btrfs_subvolumes|d([]) }}'
|
||||
tags:
|
||||
- btrfs
|
||||
|
||||
- name: ensure mount point exists
|
||||
file:
|
||||
path: '{{ item.mountpoint }}'
|
||||
state: directory
|
||||
loop: '{{ data_volumes|d([]) }}'
|
||||
|
||||
- name: ensure data volume is mounted
|
||||
mount:
|
||||
path: '{{ item.mountpoint }}'
|
||||
|
||||
Reference in New Issue
Block a user