summaryrefslogtreecommitdiff
path: root/roles/containerd/tasks/zfs.yml
blob: 60c6f3fd92a6f1fa5ebcbdf2bfd1797dda01ae49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
## containerd from ubuntu doesn't support zfs directly
## we need to create a volume create an ext4 fs on top of that...
- name: create zfs volume
  zfs:
    name: "{{ containerd_zfs.pool }}/{{ containerd_zfs.name }}"
    state: present
    extra_zfs_properties:
      volsize: "{{ containerd_zfs.size }}"

- name: create and ext4 filesystem on the zfs volume
  filesystem:
    fstype: ext4
    dev: "/dev/zvol/{{ containerd_zfs.pool }}/{{ containerd_zfs.name }}"

- name: mount filesytem
  mount:
    src: "/dev/zvol/{{ containerd_zfs.pool }}/{{ containerd_zfs.name }}"
    path: /var/lib/containerd
    fstype: ext4
    opts: defaults,x-systemd.automount,nofail
    state: mounted