From 0ef4c4a77997ae5ca18e6e75bbc8128ca1000bc9 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Wed, 12 Mar 2025 21:19:17 +0100 Subject: [PATCH] fix: add task to set persistent ZFS mountpoints in Ansible playbook --- config/ansible/tasks/servers/zfs.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/config/ansible/tasks/servers/zfs.yml b/config/ansible/tasks/servers/zfs.yml index 396d9eb..d993bc7 100644 --- a/config/ansible/tasks/servers/zfs.yml +++ b/config/ansible/tasks/servers/zfs.yml @@ -115,3 +115,24 @@ - /mnt/tvshows # - /mnt/old_backups when: datapool_check.rc == 0 + +# This is needed to actually set the mountpoints in ZFS so they are persistent after reboots! +- name: Set ZFS mountpoints + community.general.zfs: + name: "{{ item.src }}" + state: present + extra_zfs_properties: + mountpoint: "{{ item.path }}" + become: true + with_items: + - { path: /mnt/isos, src: datapool/isos } + - { path: /mnt/vms, src: datapool/vms } + - { path: /mnt/ai, src: datapool/ai } + - { path: /mnt/downloads, src: datapool/downloads } + - { path: /mnt/services, src: datapool/services } + - { path: /mnt/audiobooks, src: datapool/audiobooks } + - { path: /mnt/music, src: datapool/music } + - { path: /mnt/photos, src: datapool/photos } + - { path: /mnt/movies, src: datapool/movies } + - { path: /mnt/tvshows, src: datapool/tv_shows } + when: datapool_check.rc == 0