mrlesmithjr.kvm
ansible-kvm
An Ansible role to set up KVM.
Requirements
Install the necessary Ansible roles listed in requirements.yml:
sudo ansible-galaxy install -r requirements.yml
Role Variables
See defaults/main.yml for variable settings.
Dependencies
No additional dependencies.
Example Playbook
Here's a simple playbook example:
- hosts: kvm_hosts
vars: {}
roles:
- role: ansible-kvm
tasks: []
Booting a VM from ISO
To start a VM using an ISO, follow this example:
NOTE: Ensure the necessary variables are defined. Also, change the setting from
kvm_manage_vms: false
tokvm_manage_vms: true
.
kvm_manage_vms: true
kvm_vms:
- name: test_vm
autostart: true
# Define boot order
boot_devices:
- cdrom
- network
- hd
cdrom:
source: /path/to/iso
graphics: false
# Define disks in MB
disks:
- disk_driver: virtio
name: test_vm.1
size: 36864
memory: 512
network_interfaces:
- source: default
network_driver: virtio
portgroup: vlan-102
type: network
state: running
vcpu: 1
License
MIT License
Author Information
Larry Smith Jr.
Installa
ansible-galaxy install mrlesmithjr.kvm
Licenza
mit
Download
1.4M
Proprietario
Doing my thang with #automation #DevOps and cloudy things! Providing hopefully valuable content for others to consume easily and also learn from.