Files
ansible-playbooks/roles/zfs
Clément Désiles 045c0b9bec refactor(zfs): inline dataset ownership, add absent cleanup
Drop separate dataset-ownership.yml task file. Use
extra_zfs_properties.mountpoint directly instead of zfs get.
Add rmdir cleanup for absent dataset mountpoints.
2026-06-19 23:46:33 +02:00
..
2025-07-25 20:23:54 +02:00
2025-07-25 20:23:54 +02:00

Disks

Ansible community support for ZFS is limited to create filesystems, volumes and snapshots. There is no support for managing zpools, so here it is.

Inventory

Here is an example inventory file you can use with this role:

zfs_pools:
    - name: peace
      type: raidz1
      devices:
          - ata-SOME-DISK-LABEL-1
          - ata-SOME-DISK-LABEL-2
      options:
          ashift: 12
      root: /mnt/peace
      state: present

And you will get raid1 zpool peace with two disks, with 12 ashift.

You can use a variety of options, see the zpoolprops(7) man page.

And for your zfs filesystems:

zfs_datasets:
    - name: peace/pictures
      state: present
    - name: peace/movies
      state: present
      extra_zfs_properties:
          mountpoint: /mnt/peace/movies
          quota: 500G

References