Puppet Class: libvirt::config

Inherits:
libvirt
Defined in:
manifests/config.pp

Overview

Class: libvirt::config

Installs configuration files

Parameters:

  • qemu_hook (Any) (defaults to: $libvirt::qemu_hook)
  • qemu_conf (Any) (defaults to: $libvirt::qemu_conf)
  • uri_aliases (Any) (defaults to: $libvirt::uri_aliases)
  • uri_default (Any) (defaults to: $libvirt::uri_default)
  • default_conf (Any) (defaults to: $libvirt::default_conf)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
# File 'manifests/config.pp', line 4

class libvirt::config (
  $qemu_hook    = $libvirt::qemu_hook,
  $qemu_conf    = $libvirt::qemu_conf,
  $uri_aliases  = $libvirt::uri_aliases,
  $uri_default  = $libvirt::uri_default,
  $default_conf = $libvirt::default_conf,
) inherits libvirt {

  include ::libvirt::params

  if ($qemu_hook) {
    file {"${libvirt::params::config_dir}/hooks/qemu":
      owner  => 'root',
      group  => 'root',
      mode   => '0755',
      source => "puppet:///modules/libvirt/hooks/qemu/${libvirt::qemu_hook}",
    }
  }

  if ($qemu_conf != {}) {
    file {"${libvirt::params::config_dir}/qemu.conf":
      owner   => 'root',
      group   => 'root',
      mode    => '0600',
      content => template('libvirt/qemu.conf.erb'),
    }
  }

  if ( $uri_default != '' ) or ( $uri_aliases != [] ) {
    file {"${libvirt::params::config_dir}/libvirt.conf":
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      content => template('libvirt/libvirt.conf.erb'),
    }
  }

  $default_conf.each | String $key, String $value | {
    libvirtd_default {
      $key: value => $value;
    }
  }
}