43 lines
826 B
YAML
43 lines
826 B
YAML
---
|
|
- name: Install dependencies
|
|
apt:
|
|
name: "mergerfs"
|
|
state: present
|
|
become: yes
|
|
|
|
- name: Create folders to mount to
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
loop: "{{ fstab_entries }}"
|
|
become: true
|
|
|
|
- name: Create fstab entries
|
|
mount:
|
|
src: "UUID={{ item.uuid }}"
|
|
path: "{{ item.path }}"
|
|
fstype: "{{ item.type }}"
|
|
state: present
|
|
backup: true
|
|
loop: "{{ fstab_entries }}"
|
|
become: true
|
|
register: fstab
|
|
|
|
- name: Create/mount mergerfs
|
|
mount:
|
|
src: "{{ item.branches | join(':') }}"
|
|
path: "{{ item.path }}"
|
|
fstype: "{{ item.type }}"
|
|
opts: "{{ item.opts | join(',') }}"
|
|
state: present
|
|
backup: true
|
|
become: true
|
|
loop: "{{ mergerfs_entries }}"
|
|
register: fstab
|
|
|
|
- name: Mount all disks
|
|
command: mount -a
|
|
become: true
|
|
when: fstab.changed
|
|
|