summaryrefslogtreecommitdiff
path: root/roles/zfs/tasks/main.yml
blob: 5e891e403eb08a122c150bcd38656ba88a8cafd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
## 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: load zfs kernel module
  modprobe:
    name: zfs
    state: present

- name: install zfs file system utilities
  apt:
    name: zfsutils-linux
    state: present

- name: get zfs/zpool state
  zpool_facts:
    properties: all

- debug:
    var: ansible_zfs_pools