Awesome Open Source
Awesome Open Source

ansible-kvm

An Ansible role to install KVM

Build Status

Build Status

Requirements

Install required Ansible roles:

sudo ansible-galaxy install -r requirements.yml

Role Variables

defaults/main.yml

Dependencies

None

Example Playbook

- hosts: kvm_hosts
  vars: {}
  roles:
    - role: ansible-kvm
  tasks: []

Booting a VM from ISO

You can boot a defined VM up with an ISO by using the following example:

NOTE: Defined in your vars. Also, ensure that the default kvm_manage_vms: false is changed to kvm_manage_vms: true.

kvm_manage_vms: true
kvm_vms:
  - name: test_vm
    autostart: true
    # Define boot devices in order of preference
    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

Author Information

Larry Smith Jr.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
ansible (426
jinja (122
kvm (61
ansible-role (56
libvirt (31