fix qemu vm not installing

This commit is contained in:
Daniel Liu 2021-09-27 19:16:33 -04:00
parent c1fb658ba3
commit f72458a7b6
3 changed files with 26 additions and 22 deletions

View File

@ -1,6 +1,7 @@
---
ovmf:
vm_ram: 1G
vm_disk_size: 9G
vm_ssh_port: 22
# set this depending on your system
ovmf: /usr/share/edk2-ovmf/x64/OVMF_CODE.fd
vm_ram: 3G
vm_disk_size: 10G
vm_ssh_port: 7777 # vm doesn't seem to start with 22, leaving this here for now
userdata: "{{playbook_dir}}/userdata"

View File

@ -2,6 +2,7 @@
# Gather info
- hosts: localhost
tasks:
# make this check for the actual drive* files probably
- name: Check if vm was created already
stat:
path: "{{userdata}}"
@ -30,7 +31,7 @@
command: curl -o "{{playbook_dir}}/files/ubuntu20_04.iso" https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-live-server-amd64.iso
when: isoexists.stat.exists == false
- name: Create disk images
- name: "Create disk images"
shell:
cmd: "for i in {1..6}; do qemu-img create -f qcow2 {{userdata}}/drive${i} {{vm_disk_size}}; done"
when: vmexists.stat.exists == false

View File

@ -1,5 +1,7 @@
---
- name: Start VM
- hosts: localhost
tasks:
- name: Start VM
# async: 10000
# poll: 0
shell: