This module manages software to install and configure libvirt from within Puppet.
This is the Puppet libvirt module. Here we are providing capability within Puppet to install and configure libvirt on a host machine.
It does not take care of the creation of virtual instances - if you wish to manage instances directly in Puppet use:
https://github.com/carlasouza/puppet-virt
Warning! While this software is written in the best interest of quality it has not been formally tested by our QA teams. Use at your own risk, but feel free to enjoy and perhaps improve it while you do.
Please see the included Apache Software License for more legal details regarding warranty.
So this module was predominantly tested on:
- Debian Wheezy/libvirt 0.9.0/Puppet 2.7.0rc4
This model is known to work on:
- Fedora 16/libvirt 0.9.6/Puppet 2.7.6
Other combinations may work, and we are happy to obviously take patches to support other stacks.
As with most modules, its best to download this module from the forge:
http://forge.puppetlabs.com/puppetlabs/libvirt
If you want the bleeding edge (and potentially broken) version from github, download the module into your modulepath on your Puppetmaster. If you are not sure where your module path is try this command:
puppet --configprint modulepath
Depending on the version of Puppet, you may need to restart the puppetmasterd (or Apache) process before the functions will work.
Setup libvirt.
node "kvm1" {
class { "libvirt": }
}
Setup and configure libvirt:
node "kvm1" {
class { libvirt:
libvirtd_config => {
max_clients => { value => 10 },
},
qemu_config => {
vnc_listen => { value => "0.0.0.0" },
},
}
}
The libvirt class is responsible for installing and setting up libvirt on a host.
This parameter allows you to pass a hash that is passed to the libvirt::libvirtd_config resource.
This parameter allows you to pass a hash that is passed to the libvirt::qemu_config resource.
Basic example:
class { "libvirt": }
Example with libvirtd_config parameters for configuring your libvirtd.conf file:
class { "libvirt":
libvirtd_config => {
max_clients => { value => 5 },
tcp_port => { value => "16666" },
}
}
Example with qemu_config parameters for configuring your qemu.conf file:
class { "libvirt":
qemu_config => {
vnc_port_listen => { value => "0.0.0.0" },
}
}
This resource can be used to configure libvirt by populating items in the libvirtd.conf file.
This resource can be used to configure libvirt by populating items in the qemu.conf file.