This ansible playbook sets up libvirt and configures VM for nested KVM
This will setup the hypervisor host and also create VM
ansible-playbook -i inventory/hosts.yaml playbook/main.yaml
Currently this is tested only on Fedora 31 host. By default a fedora-32 and ubuntu-20.04 VM gets provisioned. The default fedora VM user is fedora
and password is passw0rd
. Similarly the default ubuntu VM user is ubuntu
and password is passw0rd
If you already have the hypervisor host setup, then run the following to just create a VM. Ensure you modify the variables accordingly
ansible-playbook -i inventory/hosts.yaml playbook/vm.yaml
Alternatively update examples/vm_vars.yaml
and use it
cp examples/vm_vars.yaml vm_vars.yaml
ansible-playbook -i inventory/hosts.yaml -e @vm_vars.yaml playbook/vm.yaml
ansible-playbook -i inventory/hosts.yaml playbook/delete_vm.yaml
Alternative if using custom vars file then run this
ansible-playbook -i inventory/hosts.yaml -e @vm_vars.yaml playbook/delete_vm.yaml