added compression on zfs role

This commit is contained in:
g33kex 2022-07-23 09:51:25 +02:00
parent 14a6a2ab3f
commit ebc90e7f9d
3 changed files with 8 additions and 3 deletions

View file

@ -29,6 +29,7 @@ ipv6_forwarding: false
zfs_pools:
- name: tank0
compression: 'lz4'
vdevs:
- type: raidz1
disks:
@ -40,7 +41,6 @@ zfs_pools:
properties:
autoreplace: 'on'
datasets:
- name: iso_images
- name: containers
- name: vms
- name: static
- name: dynamic

View file

@ -28,6 +28,7 @@ zfs_pools:
quota: '1T'
mountpoint: '/mnt'
- name: non_redondant_pool
compression: 'lz4'
disks:
- ada9
- ada10

View file

@ -39,6 +39,10 @@
{% endif %}
when: pool_exists.rc == 1
- name: Set pool compression
command: zfs set compression={{ pool.compression }} {{ pool.name }}
when: pool.compression is defined and pool_exists.rc == 1
- name: Create datasets in the pool
community.general.zfs:
name: "{{ pool.name }}/{{ item.name }}"