1
0
IaC/ansible/roles/hypervisor/tasks/libvirt_zfs.yaml

41 lines
1.1 KiB
YAML
Raw Normal View History

2023-08-10 20:52:27 -04:00
---
- 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 }}"