summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/volume/tasks/main.yml
blob: 7c2c27c70c53f5e25f0e2b2e48d432b579a98cd5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
- name: create zfs dataset
  zfs:
    name: "{{ zfs_volume.pool }}/{{ zfs_volume.name }}"
    extra_zfs_properties: "{{ zfs_volume.properties | dehumanize_zfs_properties | default(omit) }}"
    state: present

- name: bind mount filesystem
  vars:
    zfs_mountpoint: "{{ (zfs_pools[zfs_volume.pool].mountpoint, zfs_volume.name) | path_join }}"
  when: zfs_volume.dest != zfs_mountpoint
  mount:
    src: "{{ zfs_mountpoint }}"
    path: "{{ zfs_volume.dest }}"
    fstype: none
    opts: bind,x-systemd.automount,nofail
    state: mounted