--- - name: configure arc size when: zfs_arc_size is defined copy: content: | options zfs zfs_arc_min={{ zfs_arc_size.min }} options zfs zfs_arc_max={{ zfs_arc_size.max }} dest: /etc/modprobe.d/zfs.conf - name: install zfs modules and utilities include_tasks: "{{ ansible_distribution }}.yml" - name: load zfs kernel module modprobe: name: zfs state: present - name: create zpools loop: "{{ zfs_zpools | dict2items }}" loop_control: label: "{{ item.key }}" command: "zpool create -m {{ item.value.mountpoint }} {% for prop, value in (item.value.properties | default(zfs_zpool_properties)).items() %}-o {{ prop }}={{ value }} {% endfor %}{{ item.key }} {{ item.value.create_vdevs }}" args: creates: "{{ item.value.mountpoint }}"