Added mergerfs for my new hdd
Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>pull/1/head
parent
b6b20ae79c
commit
24c41f10ce
|
@ -19,13 +19,31 @@ pk_path: "/media/veracrypt1/genesis"
|
|||
|
||||
fstab_entries:
|
||||
- name: "config"
|
||||
path: "/opt/"
|
||||
path: "/opt"
|
||||
type: "ext4"
|
||||
uuid: "cad60133-dd84-4a2a-8db4-2881c608addf"
|
||||
- name: "media"
|
||||
path: "/media/"
|
||||
- name: "media0"
|
||||
path: "/mnt/media0"
|
||||
type: "ext4"
|
||||
uuid: "c4c724ec-4fe3-4665-adf4-acd31d6b7f95"
|
||||
- name: "media1"
|
||||
path: "/mnt/media1"
|
||||
type: "ext4"
|
||||
uuid: "8d66d395-1e35-4f5a-a5a7-d181d6642ebf"
|
||||
|
||||
mergerfs_entries:
|
||||
- name: "media"
|
||||
path: "/media"
|
||||
branches:
|
||||
- "/mnt/media0"
|
||||
- "/mnt/media1"
|
||||
opts:
|
||||
- "use_ino"
|
||||
- "allow_other"
|
||||
- "cache.files=partial"
|
||||
- "dropcacheonclose=true"
|
||||
- "category.create=mfs"
|
||||
type: "fuse.mergerfs"
|
||||
|
||||
#
|
||||
# Packages
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
---
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name: "mergerfs"
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: Create folders to mount to
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
|
@ -17,7 +23,20 @@
|
|||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue