Ansible Role for ZFS on Fedora, Red Hat/derivatives, Debian, or Ubuntu
Find a file
Josh Lay 69473489b2
All checks were successful
ansible-lint / ansible-lint (push) Successful in 36s
+yamllint rc, +docstart to role meta
2025-10-31 03:28:56 -05:00
.github/workflows workflow/pip: drop force_color on quiet install 2025-10-19 15:13:18 -05:00
defaults init 2025-10-18 16:44:11 -05:00
handlers init 2025-10-18 16:44:11 -05:00
meta +yamllint rc, +docstart to role meta 2025-10-31 03:28:56 -05:00
tasks workflow: comment assert 2025-10-19 15:48:27 -05:00
vars vars/RHEL: explicitly name kernel-{devel,headers} 2025-10-19 13:38:19 -05:00
.gitignore +lint workflow, gitignore 2025-10-19 06:48:51 -05:00
.yamllint +yamllint rc, +docstart to role meta 2025-10-31 03:28:56 -05:00
LICENSE - 2025-10-19 11:56:30 -05:00
README.md README/fedora note: brevity/link COPR 2025-10-25 11:12:46 -05:00
requirements.yml requirements (ansible): linting/workflow comment 2025-10-19 14:30:59 -05:00

zfs_dkms

Ansible Role for ZFS on Fedora, Red Hat/derivatives, Debian, or Ubuntu.

Role Variables

Variable Description Role Default Upstream Default
zfs_dkms_arc_pct_min Minimum physical memory (%) for ARC.
(Adaptive Read Cache)
0 0
zfs_dkms_arc_pct_max Peak physical memory (%) for ARC. 16 0
zfs_dkms_timeout Seconds to wait while rebooting Fedora, RHEL, or derivatives for kernel/header currency. Not applicable to Debian or Ubuntu.

Skipped when zfs is already loaded.
3600 N/A

Dependencies

  1. community.general: use modules rhsm_repository, dnf_config_manager, and modprobe

Example Playbook

---
- name: ZFS + Pool
  hosts: all
  vars:
    zfs_mirror_disks:  # see NOTE below
      - /dev/disk/by-id/ata-WDC_WD120EFBX-ABCDEFG_12345678
      - /dev/disk/by-id/ata-WDC_WD120EFBX-HIJKLMN_87654321
  roles:
    - name: zfs_dkms  # this role, installs/builds ZFS
      vars:
        zfs_dkms_arc_pct_max: 33
  tasks:
    - name: "Pool (mirror, 'rust')"  # see also: 'community.general.zfs'
      when: zfs_mirror_disks is defined
      community.general.zpool:
        name: rust
        pool_properties:
          ashift: 12
        filesystem_properties:
          compression: lz4
        vdevs:
          - type: mirror
            disks: "{{ zfs_mirror_disks }}"  # reminder: see NOTE below
      become: true

NOTE: Not recommended to inline zfs_mirror_disks, zfs_dkms_arc_pct_max, or pool/filesystem properties. Values are expected to be unique among hosts [or groups].
Use the inventory or host/group vars instead.

Help

Package not found (Fedora)

DNF may fail to find packages on Fedora when the kernel is not supported by ZFS. Previously-installed kernels, or LTS [from third-parties/COPR], may be advisable until the latest 'stable' is supported.

License

MIT