homeserver/roles/mgrote.zfs_manage_datasets/tasks/main.yml
2021-02-07 10:53:08 +01:00

23 lines
929 B
YAML

---
- name: create datasets
become: true
community.general.zfs:
name: "{{ item.dataset }}"
state: "{{ item.state | default('present') }}"
loop: "{{ zfs_datasets }}"
when: zfs_datasets is defined # führe nur aus wenn die Variable gesetzt ist
- name: set zfs properties per datasets
become: true
community.general.zfs:
name: "{{ item.dataset }}"
state: "{{ item.state | default('present') }}"
extra_zfs_properties:
compression: "{{ item.compression | default('lz4') }}"
sync: "{{ item.sync | default('standard') }}"
xattr: "{{ item.xattr | default('on') }}"
dnodesize: "{{ item.dnodesize | default('auto') }}"
atime: "{{ item.atime | default('off') }}"
snapdir: "{{ item.snapdir | default('hidden') }}"
loop: "{{ zfs_datasets }}"
when: zfs_datasets is defined # führe nur aus wenn die Variable gesetzt ist