--- - name: create lvm-based disks for vm loop: "{{ hostvars[install_hostname].install_cooked.disks.virtio | default({}) | combine(hostvars[install_hostname].install_cooked.disks.scsi | default({})) | dict2items }}" loop_control: label: "{% if item.value.type == 'lvm' %}{{ item.value.vg }} / {{ item.value.lv }} ({{ item.value.size }}){% else %}unused{% endif %}" when: item.value.type == 'lvm' lvol: vg: "{{ item.value.vg }}" lv: "{{ item.value.lv }}" size: "{{ item.value.size }}" state: present - name: create zfs-based disks for vm loop: "{{ hostvars[install_hostname].install_cooked.disks.virtio | default({}) | combine(hostvars[install_hostname].install_cooked.disks.scsi | default({})) | dict2items }}" loop_control: label: "{% if item.value.type == 'zfs' %}{{ item.value.pool }} / {{ item.value.name }} ({{ item.value.size }}){% else %}unused{% endif %}" when: item.value.type == 'zfs' zfs: name: "{{ item.value.pool }}/{{ item.value.name }}" state: present extra_zfs_properties: volsize: "{{ item.value.size }}" - block: - name: create a temporary workdir tempfile: state: directory register: tmpdir - when: install_distro in ['debian', 'ubuntu'] vars: ssh_keys_root: "{{ hostvars[install_hostname].ssh_keys_root }}" preseed_tmpdir: "{{ tmpdir.path }}" preseed_force_net_ifnames_policy: path preseed_no_netplan: yes install_interface: enp1s1 import_role: name: installer/debian/preseed - when: install_distro in ['openbsd'] vars: ssh_keys_root: "{{ hostvars[install_hostname].ssh_keys_root }}" obsd_autoinstall_tmpdir: "{{ tmpdir.path }}" obsd_autoinstall_serial_device: com0 install_interface: vio0 import_role: name: installer/openbsd/autoinstall - name: Make installer workdir readable by qemu acl: path: "{{ tmpdir.path }}" state: present entity: libvirt-qemu etype: user permissions: rx - import_role: name: vm/define vars: vm_define_installer: yes preseed_tmpdir: "{{ tmpdir.path }}" - debug: msg: "you can check on the status of the installer running this command 'virsh console {{ install_hostname }}' on host {{ inventory_hostname }}." - when: installer_manual_steps_msg is defined pause: prompt: | Mind that this installer needs manual steps to be performed: {{ installer_manual_steps_msg | indent(2) }} When done press enter to continue or Ctrl-C + 'A' to abort. - name: wait for installer to finish or crash wait_for_virt: name: "{{ install_hostname }}" states: shutdown,crashed timeout: 1800 register: installer_result failed_when: installer_result.failed or installer_result.state == "crashed" always: - name: cleanup temporary workdir file: path: "{{ tmpdir.path }}" state: absent - import_role: name: vm/define vars: vm_define_installer: no