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:
2024-09-01 08:54:08 -05:00
parent 9d60ae1a61
commit b6cc83ad82

View File

@@ -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 }}'