From d87ec89887eede3589688c451fa43e50b5fcb24c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 9 Jan 2021 22:25:29 +0000 Subject: [PATCH] Persist arc size Modprobe only loads the module, it doesn't ensure the ARC value persists correctly. --- ansible/roles/zfs/files/zfs-modprobe.conf | 1 + ansible/roles/zfs/tasks/main.yml | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 ansible/roles/zfs/files/zfs-modprobe.conf diff --git a/ansible/roles/zfs/files/zfs-modprobe.conf b/ansible/roles/zfs/files/zfs-modprobe.conf new file mode 100644 index 0000000..d40f2ed --- /dev/null +++ b/ansible/roles/zfs/files/zfs-modprobe.conf @@ -0,0 +1 @@ +options zfs zfs_arc_max={{ zfs_arc_size }} diff --git a/ansible/roles/zfs/tasks/main.yml b/ansible/roles/zfs/tasks/main.yml index 635d425..f170ca3 100644 --- a/ansible/roles/zfs/tasks/main.yml +++ b/ansible/roles/zfs/tasks/main.yml @@ -1,8 +1,9 @@ -- name: Enable zfs module - modprobe: - name: zfs - state: present - params: zfs_arc_max={{ zfs_arc_size }} +- name: Set module options + template: + src: files/zfs-modprobe.conf + dest: /etc/modprobe.d/zfs.conf + mode: "0644" + become: true - name: ZFS Scrub cron: