--- - name: fetch debian installer and bake initrd hosts: "{{ install_hostname }}" connection: local gather_facts: no vars_prompt: - name: usb_install_path prompt: Where is the USB installation medium mounted to? private: no roles: - role: installer/debian/usb installer_path: "{{ global_cache_dir }}/debian-installer" post_tasks: - name: Make the USB disk bootable pause: seconds: 0 prompt: | You should make sure the USB disk is bootable and has syslinux installed. $ sudo apt install mbr syslinux $ sudo install-mbr /dev/CHANGEME $ sudo syslinux -i /dev/CHANGEME1 $ sudo fdisk /dev/CHANGEME [Here, make sure partition 1 is marked bootable.] for UEFI these steps need to be done $ sudo apt install syslinux-efi $ cp /usr/lib/syslinux/modules/efi64/* {{ usb_install_path }}/EFI/boot/ $ cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi {{ usb_install_path }}/EFI/boot/bootx64.efi This will NOT be done automatically. - name: wait for new machine to start up hosts: "{{ install_hostname }}" gather_facts: no tasks: - pause: prompt: | Please plug the stick into the machine and boot from it. When the installation is done press enter to continue or Ctrl-C + 'A' to abort. ## TODO: find a better way to fetch host key of new VMs - name: disable ssh StrictHostKeyChecking for the next step set_fact: ansible_ssh_extra_args: -o StrictHostKeyChecking=no - name: clear all gathered facts meta: clear_facts - name: wait for vm to start up wait_for_connection: delay: 5 timeout: 120 - name: reenable StrictHostKeyChecking set_fact: ansible_ssh_extra_args: "" - name: run host playbook vars: params: files: - "../{{ install_environment }}/{{ install_hostname }}.yml" - "../{{ install_environment }}/{{ install_playbook | default('common') }}.yml" import_playbook: "{{ q('first_found', params) | first }}"