Libvirt Host
This role configures a host as a Libvirt/KVM hypervisor. It can also configure storage pools and networks on the host.
Requirements
The host should have Virtualization Technology (VT) enabled.
Role Variables
libvirt_host_networks is a list of pools to define and start. Each item
should be a dict containing the following items:
nameThe name of the pool.typeThe type of the pool, currently onlydiris supported.capacityThe capacity, in bytes, of the pool.pathThe absolute path to the pool's backing directory.modeThe access mode of the pool.ownerThe owner of the pool.groupThe group of the pool.
libvirt_host_networks is a list of networks to define and start. Each item
should be a dict containing the following items:
nameThe name of the network.modeThe forwarding mode of the network, currently onlybridgeis supported.- bridge` The name of the bridge interface for this network.
Dependencies
None
Example Playbook
---
- name: Ensure that Libvirt is configured
hosts: all
roles:
- role: libvirt-host
libvirt_host_pools:
- name: my-pool
type: dir
capacity: 1024
path: /path/to/pool
mode: 0755
owner: my-user
group: my-group
libvirt_host_networks:
- name: br-example
mode: bridge
bridge: br-example
Author Information
- Mark Goddard (mark@stackhpc.com)