41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
---
|
|
|
|
- name: Create libvirt zfs dataset(s)
|
|
community.general.zfs:
|
|
name: "{{ item.name }}"
|
|
state: present
|
|
extra_zfs_properties: # TODO fix property values
|
|
canmount: false
|
|
mountpoint: none
|
|
compression: false
|
|
primarycache: metadata
|
|
secondarycache: none
|
|
reservation: none
|
|
refreservation: none
|
|
dedup: false
|
|
encryption: "{{ item.encryption | default('off') }}"
|
|
volmode: dev
|
|
devices: false
|
|
atime: false
|
|
loop: "{{ hypervisor.datasets }}"
|
|
|
|
- name: Define additional libvirt storage pools
|
|
community.libvirt.virt_pool:
|
|
name: "{{ item.name | split('/') | last }}"
|
|
command: define
|
|
xml: "{{ lookup('template', 'zfs_libvirt_pool.xml.j2') }}"
|
|
loop: "{{ hypervisor.datasets }}"
|
|
|
|
- name: Create additional libvirt storage pools
|
|
community.libvirt.virt_pool:
|
|
name: "{{ item.name | split('/') | last }}"
|
|
command: build
|
|
loop: "{{ hypervisor.datasets }}"
|
|
|
|
- name: Start additional libvirt storage pools
|
|
community.libvirt.virt_pool:
|
|
name: "{{ item.name | split('/') | last }}"
|
|
state: active
|
|
autostart: true
|
|
loop: "{{ hypervisor.datasets }}"
|