ansible-roles/roles/zfs_common/templates/zfs.conf.j2
2021-12-01 19:13:34 +01:00

16 lines
872 B
Django/Jinja

# {{ ansible_managed }}
{% if zfs_arc_min is defined %}
options zfs zfs_arc_min={{ zfs_arc_min is search('%$') | ternary(((zfs_arc_min | regex_replace('%$', '') | int) * ansible_memtotal_mb * 1024 * 1024 * 0.01) | int, zfs_arc_min) }}
{% endif %}
{% if zfs_arc_max is defined %}
options zfs zfs_arc_max={{ zfs_arc_max is search('%$') | ternary(((zfs_arc_max | regex_replace('%$', '') | int) * ansible_memtotal_mb * 1024 * 1024 * 0.01) | int, zfs_arc_max) }}
{% endif %}
#options zfs zvol_threads={{ (ansible_processor_vcpus < 16) | ternary('16', (ansible_processor_vcpus > 32) | ternary('32', ansible_processor_vcpus)) }}
{% for option in zfs_mod_params.keys() | list %}
{% if option is match('zfs_') %}
options zfs {{ option }}={{ zfs_mod_params[option] }}
{% elif option is match('spl_') %}
options spl {{ option }}={{ zfs_mod_params[option] }}
{% endif %}
{% endfor %}