Puppet Class: libvirt::install

Inherits:
libvirt
Defined in:
manifests/install.pp

Overview

libvirt::install

Parameters:

  • qemu_hook (String) (defaults to: $libvirt::qemu_hook)

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

  • packages (Array) (defaults to: $libvirt::libvirt_package_names)

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

  • qemu_hook_packages (Hash) (defaults to: $libvirt::qemu_hook_packages)

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

  • package_ensure (String) (defaults to: 'installed')

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



22
23
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
# File 'manifests/install.pp', line 22

class libvirt::install (
  String $qemu_hook          = $libvirt::qemu_hook,
  Array  $packages           = $libvirt::libvirt_package_names,
  Hash   $qemu_hook_packages = $libvirt::qemu_hook_packages,
  String $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',
    }
  }
}