summaryrefslogtreecommitdiff
path: root/roles/containerd/tasks/zfs.yml
blob: 2ebcae3ce804eb65cb8704591c2750a3fcd8809b (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
---
## containerd from ubuntu doesn't support zfs directly
## we need to create a volume and an ext4 fs on top of that...
- name: verify that the zfs volsize property is set
  assert:
    msg: "contained does not support zfs directly - please set the volsize property to make it a volume"
    that: "'volsize' in containerd_zfs.properties"

- name: create zfs volume
  zfs:
    name: "{{ containerd_zfs.pool }}/{{ containerd_zfs.name }}"
    state: present
    extra_zfs_properties: "{{ containerd_zfs.properties }}"

- 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