summaryrefslogtreecommitdiff
path: root/roles/zfs
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-09-09 21:53:08 +0200
committerChristian Pointner <equinox@spreadspace.org>2019-09-09 21:53:08 +0200
commitf41199feae553f0d2269f507382a82470277c8ae (patch)
treee09934c5ec08f3ad836b47398c86d1e85057d8da /roles/zfs
parentadded admin-user role to mimas (diff)
added zfs role
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