compute/hypervisor: refactorize console management

In a previous commit, the way to call nova::compute was not really
optimal. Now it's configuring nova::compute automatically for Spice &
novnc cases.
Also fix the doc for server_proxyclient_address param.

Change-Id: I626601507a55ca60e05c8160176fe4a67e54cb3a
This commit is contained in:
Emilien Macchi 2014-12-15 09:59:51 -05:00
parent 121c648960
commit e56be23a58

View File

@ -20,7 +20,7 @@
# === Parameters: # === Parameters:
# #
# [*server_proxyclient_address*] # [*server_proxyclient_address*]
# (optional) Hostname or IP used to connect to Spice service. # (optional) The IP address of the server running the console proxy client
# Defaults to '127.0.0.1' # Defaults to '127.0.0.1'
# #
# [*libvirt_type*] # [*libvirt_type*]
@ -238,38 +238,32 @@ Host *
case $console { case $console {
'spice': { 'spice': {
class { 'nova::compute': $vnc_enabled = false
enabled => true,
vnc_enabled => false,
virtio_nic => false,
neutron_enabled => true
}
class { 'nova::compute::spice': class { 'nova::compute::spice':
server_listen => '0.0.0.0', server_listen => '0.0.0.0',
server_proxyclient_address => $server_proxyclient_address, server_proxyclient_address => $server_proxyclient_address,
proxy_host => $ks_console_public_host, proxy_host => $ks_console_public_host,
proxy_protocol => $ks_console_public_proto, proxy_protocol => $ks_console_public_proto,
proxy_port => $spice_port proxy_port => $spice_port,
} }
} }
'novnc': { 'novnc': {
class { 'nova::compute': $vnc_enabled = true
enabled => true,
vnc_enabled => true,
vncserver_proxyclient_address => $server_proxyclient_address,
vncproxy_host => $ks_console_public_host,
vncproxy_protocol => $ks_console_public_proto,
vncproxy_port => $novnc_port,
virtio_nic => false,
neutron_enabled => true
}
} }
default: { default: {
fail("upported console type ${console}") fail("unsupported console type ${console}")
} }
} }
class { 'nova::compute':
enabled => true,
vnc_enabled => $vnc_enabled,
vncserver_proxyclient_address => $server_proxyclient_address,
vncproxy_host => $ks_console_public_host,
vncproxy_protocol => $ks_console_public_proto,
vncproxy_port => $novnc_port,
virtio_nic => false,
neutron_enabled => true
}
if $::osfamily == 'RedHat' { if $::osfamily == 'RedHat' {
file { '/etc/libvirt/qemu.conf': file { '/etc/libvirt/qemu.conf':