Skip to content

Commit

Permalink
ansible/qemu-vm: Start the VMs
Browse files Browse the repository at this point in the history
Start the VMs (i.e., PXE clients) now that the PXE Server is configured.
Each VM should boot from the network and use the preseed file to
automatically complete the Debian installation.

Signed-off-by: Dimitris Poulopoulos <[email protected]>
  • Loading branch information
dpoulopoulos committed Mar 7, 2024
1 parent b0474bf commit 82db2f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ansible/roles/qemu-vm/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@
community.libvirt.virt:
command: define
xml: "{{ lookup('template', 'vm-template.xml.j2') }}"

- name: Start the PXE client
community.libvirt.virt:
name: "{{ inventory_hostname }}"
command: start
state: running
delegate_to: "{{ vm_host }}"
when: pxe_done
8 changes: 8 additions & 0 deletions ansible/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@
roles:
- role: pxe-client

- name: Start QEMU VMs
hosts: qemu
tags: qemu-vm
gather_facts: false
roles:
- role: qemu-vm
vars:
pxe_done: true

0 comments on commit 82db2f5

Please sign in to comment.