summaryrefslogtreecommitdiff
path: root/roles/vm/host/tasks/zfs.yml
blob: b88ee73e6718532a992535e1cf11423ac3707ecc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
- name: create zfs base datasets
  loop: "{{ lookup('dict', vm_host.zfs, wantlist=True)  }}"
  loop_control:
    label: "{{ item.key }} -> {{ item.value.pool }}/{{ item.value.name }}{% if 'quota' in item.value %}={{ item.value.quota }}{% endif %}"
  zfs:
    name: "{{ item.value.pool }}/{{ item.value.name }}"
    state: present
    extra_zfs_properties:
      quota: "{{ item.value.quota | default(omit) }}"
      canmount: no
      mountpoint: none

- name: configure lvm to ignore zfs volumes
  lineinfile:
    path: /etc/lvm/lvm.conf
    backrefs: yes
    regexp: '^\s*#?\s*global_filter\s*='
    line: '        global_filter = [ "r|/dev/zd[0-9]+|" ]'