File: spice.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 (64 lines) | stat: -rw-r--r-- 1,810 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
56
57
58
59
60
61
62
63
64
# == Class: nova::compute::spice
#
# Configure spice on the compute side
#
# === Parameters:
#
# [*agent_enabled*]
#   (optional) enable spice guest agent support
#   Defaults to true
#
# [*server_listen*]
#   (optional)  IP address on which instance spice servers should listen
#   Defaults to $facts['os_service_default']
#
# [*server_proxyclient_address*]
#   (optional) Management IP Address on which instance spiceservers will
#   listen on the compute host.
#   Defaults to '127.0.0.1'
#
# [*proxy_host*]
#   (optional) Host for the html5 console proxy
#   Defaults to undef
#
# [*proxy_port*]
#   (optional) Port for the html5 console proxy
#   Defaults to '6082'
#
# [*proxy_protocol*]
#   (optional) Protocol for the html5 console proxy
#   Defaults to 'http'
#
# [*proxy_path*]
#   (optional) Path of the spice html file for the html5 console proxy
#   Defaults to '/spice_auto.html'
#
class nova::compute::spice(
  Boolean $agent_enabled      = true,
  $server_listen              = $facts['os_service_default'],
  $server_proxyclient_address = '127.0.0.1',
  $proxy_host                 = undef,
  $proxy_protocol             = 'http',
  $proxy_port                 = '6082',
  $proxy_path                 = '/spice_auto.html',
) {

  include nova::deps

  if $proxy_host {
    $html5proxy_base_url = "${proxy_protocol}://${proxy_host}:${proxy_port}${proxy_path}"
    nova_config {
      'spice/html5proxy_base_url': value => $html5proxy_base_url;
    }
  } else {
    nova_config {
      'spice/html5proxy_base_url': value => $facts['os_service_default'];
    }
  }

  nova_config {
    'spice/agent_enabled':              value => $agent_enabled;
    'spice/server_listen':              value => $server_listen;
    'spice/server_proxyclient_address': value => $server_proxyclient_address;
  }
}