From 9a8c06e53273fb6fb35c16aeb2429320b421f6a8 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 3 Jan 2022 22:42:20 +0100 Subject: first basic version of openwrt-based vms --- roles/vm/guest/deploy/tasks/main.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 roles/vm/guest/deploy/tasks/main.yml (limited to 'roles/vm/guest/deploy/tasks') diff --git a/roles/vm/guest/deploy/tasks/main.yml b/roles/vm/guest/deploy/tasks/main.yml new file mode 100644 index 00000000..cc9733ba --- /dev/null +++ b/roles/vm/guest/deploy/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- name: fetch infos from image file + delegate_to: localhost + stat: + path: "{{ output_images | first }}" + get_mime: yes + register: output_image_info + + ## TODO: prepare directory for disk images + ## TODO: compute disk path based on install.disks.primary and install.disks.(scsi|virtio) + ## TODO: actually call this directly and make file replacement atomic!! +- name: copy disk image + pause: + prompt: | + Please copy the image to the vm-host i.e. by calling this: + + cat {{ output_image_info.stat.path }} | {{ vm_deploy_decompressors[output_image_info.stat.mimetype] }} | ssh {{ vm_host.name }} 'cat > {{ install.disks.scsi.sda.path }}' + + When done press ENTER to continue or CTRL-C then A to abort. + +- name: define vm + vars: + vm_define_installer: no + delegate_to: "{{ vm_host.name }}" + import_role: + name: vm/guest/define -- cgit v1.2.3