summaryrefslogtreecommitdiff
path: root/roles/zfs
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-04-26 04:32:59 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-04-26 04:33:18 +0200
commit112780881efa6dc649d7844695e78c0af15729ca (patch)
tree69722a75659873bc90c2b8276d40cd2b89b31e05 /roles/zfs
parentdebian/installer: add support for ubuntu focal (diff)
zfs: don't install dkms on unbuntu
Diffstat (limited to 'roles/zfs')
-rw-r--r--roles/zfs/base/tasks/Debian.yml18
-rw-r--r--roles/zfs/base/tasks/Ubuntu.yml2
-rw-r--r--roles/zfs/base/tasks/main.yml19
3 files changed, 22 insertions, 17 deletions
diff --git a/roles/zfs/base/tasks/Debian.yml b/roles/zfs/base/tasks/Debian.yml
new file mode 100644
index 00000000..450d9300
--- /dev/null
+++ b/roles/zfs/base/tasks/Debian.yml
@@ -0,0 +1,18 @@
+---
+## TODO: make sure contrib repo is enabled
+
+- name: install zfs-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
diff --git a/roles/zfs/base/tasks/Ubuntu.yml b/roles/zfs/base/tasks/Ubuntu.yml
new file mode 100644
index 00000000..0ce85358
--- /dev/null
+++ b/roles/zfs/base/tasks/Ubuntu.yml
@@ -0,0 +1,2 @@
+---
+# Nothing to do here.
diff --git a/roles/zfs/base/tasks/main.yml b/roles/zfs/base/tasks/main.yml
index 0a968235..e6f2347b 100644
--- a/roles/zfs/base/tasks/main.yml
+++ b/roles/zfs/base/tasks/main.yml
@@ -7,23 +7,8 @@
options zfs zfs_arc_max={{ zfs_arc_size.max }}
dest: /etc/modprobe.d/zfs.conf
-## TODO: @debian: make sure contrib repo is added
-
-- name: install zfs packages
- 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
+- name: install zfs modules
+ include_tasks: "{{ ansible_distribution }}.yml"
- name: load zfs kernel module
modprobe: