diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index ccaa6d2..921274c 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -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 diff --git a/roles/common/tasks/aya01_fstab.yml b/roles/common/tasks/aya01_fstab.yml index 6346975..1b89f2e 100644 --- a/roles/common/tasks/aya01_fstab.yml +++ b/roles/common/tasks/aya01_fstab.yml @@ -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 +