Puppet Class: libvirt::install

Inherits:
libvirt
Defined in:
manifests/install.pp

Overview

Class: libvirt::install

Installs the required packages and files

Parameters

qemu_hook

QEMU hook to install. The only currently available hook is a script to setup DRBD resources. Valid values are 'drbd' or 'undef' (=no hook). Default inherited from ::libvirt class

packages

Array of the libvirt package names to install. Default inherited from ::libvirt class

qemu_hook_packages

Hash of Arrays of hook specific packages to install Default inherited from ::libvirt class

package_ensure

What state the packages should be in. Defaults to 'installed'

Parameters:

  • qemu_hook (Any) (defaults to: $libvirt::qemu_hook)
  • packages (Any) (defaults to: $libvirt::libvirt_package_names)
  • qemu_hook_packages (Any) (defaults to: $libvirt::qemu_hook_packages)
  • package_ensure (Any) (defaults to: 'installed')


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'manifests/install.pp', line 24

class libvirt::install (
  $qemu_hook          = $libvirt::qemu_hook,
  $packages           = $libvirt::libvirt_package_names,
  $qemu_hook_packages = $libvirt::qemu_hook_packages,
  $package_ensure     = 'installed',
) inherits libvirt {

  package { $packages:
    ensure => $package_ensure,
  }

  # install hook specific packages
  if ($qemu_hook_packages[$qemu_hook]) {
    package {$qemu_hook_packages[$qemu_hook]:
      ensure => $package_ensure,
    }
  }

  # install managment script for drbd hook
  if ($qemu_hook == 'drbd') {
    file {'/usr/local/sbin/manage-domains':
      ensure => 'present',
      owner  => 'root',
      group  => 'root',
      mode   => '0755',
      source => 'puppet:///modules/libvirt/scripts/manage-domains',
    }
  }
}