2022-12-06 16:36:21 +01:00
|
|
|
---
|
2023-04-24 18:37:58 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
apt:
|
|
|
|
name: "mergerfs"
|
|
|
|
state: present
|
|
|
|
become: yes
|
|
|
|
|
2022-12-06 16:36:21 +01:00
|
|
|
- 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
|
2022-12-29 22:45:17 +01:00
|
|
|
register: fstab
|
2022-12-06 16:36:21 +01:00
|
|
|
|
2023-04-24 18:37:58 +02:00
|
|
|
- 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
|
|
|
|
|
2022-12-06 16:36:21 +01:00
|
|
|
- name: Mount all disks
|
|
|
|
command: mount -a
|
|
|
|
become: true
|
2022-12-29 22:45:17 +01:00
|
|
|
when: fstab.changed
|
2023-04-24 18:37:58 +02:00
|
|
|
|