File: qemu.pp

package info (click to toggle)
puppet-module-nova 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,100 kB
  • sloc: ruby: 11,433; python: 38; sh: 10; makefile: 10
file content (55 lines) | stat: -rw-r--r-- 1,714 bytes parent folder | download
1
2
3
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
47
48
49
50
51
52
53
54
55
# == Class: nova::migration::qemu
#
# Sets qemu config that is required for migration
#
# === Parameters:
#
# [*configure_qemu*]
#   (optional) Whether or not configure qemu bits.
#   Defaults to false.
#
# [*migration_address*]
#   (optional) Override the listen address for all incoming migrations.
#   Defaults to $facts['os_service_default'].
#
# [*migration_host*]
#   (optional) The default hostname or IP address which will be used by
#   a migration source for transferring migration data to this host.
#   Defaults to $facts['os_service_default'].
#
# [*migration_port_min*]
#   (optional) Lower limit of port range used for migration.
#   Defaults to $facts['os_service_default'].
#
# [*migration_port_max*]
#   (optional) Higher limit of port range used for migration.
#   Defaults to $facts['os_service_default'].
#
class nova::migration::qemu(
  Boolean $configure_qemu = false,
  $migration_address      = $facts['os_service_default'],
  $migration_host         = $facts['os_service_default'],
  $migration_port_min     = $facts['os_service_default'],
  $migration_port_max     = $facts['os_service_default'],
){

  include nova::deps

  Qemu_config<||> ~> Service<| tag == 'libvirt-qemu-service' |>

  if $configure_qemu {
    qemu_config {
      'migration_address':  value => $migration_address;
      'migration_host':     value => $migration_host;
      'migration_port_min': value => $migration_port_min;
      'migration_port_max': value => $migration_port_max;
    }
  } else {
    qemu_config {
      'migration_address':  ensure => absent;
      'migration_host':     ensure => absent;
      'migration_port_min': ensure => absent;
      'migration_port_max': ensure => absent;
    }
  }
}