summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/pools/tasks/Debian.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-04 00:51:06 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-04 00:51:06 +0200
commit1f3ad3812836ed0f8f4f290346014821e6601c4d (patch)
tree0a973d531da3e61ae33e4ee79542f0ed69dabeb3 /roles/storage/zfs/pools/tasks/Debian.yml
parentmove cryptdisk role to new storage subdir (diff)
move zfs roles to new storage subdir
Diffstat (limited to 'roles/storage/zfs/pools/tasks/Debian.yml')
-rw-r--r--roles/storage/zfs/pools/tasks/Debian.yml42
1 files changed, 42 insertions, 0 deletions
diff --git a/roles/storage/zfs/pools/tasks/Debian.yml b/roles/storage/zfs/pools/tasks/Debian.yml
new file mode 100644
index 00000000..a1ed0387
--- /dev/null
+++ b/roles/storage/zfs/pools/tasks/Debian.yml
@@ -0,0 +1,42 @@
+---
+- name: install dkms
+ import_role:
+ name: prepare-dkms
+
+- name: check if contrib apt component is enabled
+ assert:
+ msg: "Debian zfs packages are in contrib - please enable it using 'apt_repo_components'"
+ that:
+ - apt_repo_components is defined
+ - "'contrib' in apt_repo_components"
+
+- name: enable backports and force ZFS packages from backports for buster
+ when: (ansible_distribution_major_version | int) == 10
+ block:
+ - name: add backports repo
+ include_role:
+ name: apt-repo/backports
+
+ - name: pin zfs packages to buster-backports
+ copy:
+ content: |
+ Package: libnvpair1linux libuutil1linux libzfs2linux libzpool2linux spl-dkms zfs-dkms zfs-test zfsutils-linux zfsutils-linux-dev zfs-zed
+ Pin: release n=buster-backports
+ Pin-Priority: 990
+ dest: /etc/apt/preferences.d/zfs-from-buster-backports
+
+- name: install zfs modules via dkms
+ apt:
+ name: zfs-dkms
+ state: present
+
+- name: check if module is available for the currently running kernel
+ command: modprobe --dry-run zfs
+ check_mode: no
+ register: zfs_module_available
+ failed_when: false
+ changed_when: false
+
+- name: rebuild zfs module
+ when: zfs_module_available.rc != 0
+ command: dpkg-reconfigure zfs-dkms