--- - name: Create the libvirt storage directories ansible.builtin.file: path: "{{ item }}" state: directory owner: libvirt-qemu group: libvirt-qemu mode: '0775' loop: - /var/lib/libvirt/vhds/ - name: Define additional libvirt storage pools community.libvirt.virt_pool: name: "{{ item.name }}" command: define xml: "{{ lookup('template', 'dir_libvirt_pool.xml.j2') }}" loop: - name: vhds path: /var/lib/libvirt/vhds/ - name: Create additional libvirt storage pools community.libvirt.virt_pool: name: "{{ item }}" command: build loop: - vhds - name: Start additional libvirt storage pools community.libvirt.virt_pool: name: "{{ item }}" state: active autostart: true loop: - vhds