You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-homelab/roles/setup_mergerfs/tasks/main.yml

36 lines
921 B
YAML

- name: Mount Volumes
ansible.builtin.mount:
path: '{{ item.path }}'
src: UUID={{ item.uuid }}
fstype: ext4
state: mounted
opts: defaults,nofail
loop: '{{ devices }}'
register: volume_out
- name: Display volumes.
ansible.builtin.debug:
var: '{{ volume_out }}'
verbosity: 3
# tasks file for setup_mergerfs
- name: Create Mergerfs directory
ansible.builtin.file:
path: /mnt/mergerfs
state: directory
owner: cianhatton
group: cianhatton
mode: 0775
register: directory_creation
# Ensure the actual folder can't be written to only when it has just been created.
- name: Make /mnt/mergerfs immutable
ansible.builtin.command: chattr +i /mnt/mergerfs
when: directory_creation.diff.after.path != directory_creation.diff.before.path
- name: Create Mergerfs pool
ansible.builtin.include_role:
name: sprat.mergerfs
vars:
mergerfs_mounts: '{{ mounts }}'