Initial version of libvirt module
This commit is contained in:
parent
6013834928
commit
d523669f18
2 changed files with 379 additions and 0 deletions
52
libvirt/manifests/init.pp
Normal file
52
libvirt/manifests/init.pp
Normal file
|
@ -0,0 +1,52 @@
|
|||
# Install libvirt software.
|
||||
#
|
||||
class libvirt::client {
|
||||
|
||||
case $operatingsystem {
|
||||
centos,fedora: {
|
||||
package { [ "libvirt", "virt-manager", "virt-viewer", ]:
|
||||
ensure => installed,
|
||||
}
|
||||
}
|
||||
default: {
|
||||
fail("Not supported on ${operatingsystem}.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install and configure KVM and libvirtd.
|
||||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $libvirt_admingroup:
|
||||
# Group which has access to system libvirtd.
|
||||
#
|
||||
class libvirt::kvm inherits libvirt::client {
|
||||
|
||||
package { "qemu-kvm":
|
||||
ensure => installed,
|
||||
before => Service["libvirtd"],
|
||||
}
|
||||
|
||||
if !$libvirt_admingroup {
|
||||
$libvirt_admingroup = "root"
|
||||
}
|
||||
|
||||
file { "/etc/libvirt/libvirtd.conf":
|
||||
ensure => present,
|
||||
mode => 0644,
|
||||
owner => "root",
|
||||
group => "root",
|
||||
content => template("libvirt/libvirtd.conf.erb"),
|
||||
require => Package["libvirt"],
|
||||
notify => Service["libvirtd"],
|
||||
}
|
||||
|
||||
service { "libvirtd":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue