datavol: Support creating btrfs subvolumes

Set the `btrfs_subvolumes` variable to an array of objects with `name`
and `device` properties to create btrfs subvolumes.
frigate-exporter
Dustin 2024-09-01 08:54:08 -05:00
parent 9d60ae1a61
commit b6cc83ad82
1 changed files with 15 additions and 0 deletions

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