summaryrefslogtreecommitdiff
path: root/roles/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'roles/zfs')
-rw-r--r--roles/zfs/meta/main.yml3
-rw-r--r--roles/zfs/tasks/main.yml26
2 files changed, 29 insertions, 0 deletions
diff --git a/roles/zfs/meta/main.yml b/roles/zfs/meta/main.yml
new file mode 100644
index 00000000..300d0ccf
--- /dev/null
+++ b/roles/zfs/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+- role: prepare-dkms
diff --git a/roles/zfs/tasks/main.yml b/roles/zfs/tasks/main.yml
new file mode 100644
index 00000000..478a25dd
--- /dev/null
+++ b/roles/zfs/tasks/main.yml
@@ -0,0 +1,26 @@
+---
+## TODO: @debian: make sure contrib repo is added
+
+- name: install zfs packages
+ apt:
+ name:
+ - zfs-dkms
+ - zfsutils-linux
+ 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: check again if module is available for the currently running kernel
+ when: zfs_module_available.rc != 0
+ command: modprobe --dry-run zfs
+ check_mode: no
+ changed_when: false