compute: Fix nova vncproxy protocol

https://review.openstack.org/#/c/190464/ introduced a new parameter for
nova::vncproxy with a default value set to http.
To be able to configure vncproxy with https we need to add also a new
parameter in cloud::compute::consoleproxy

Change-Id: I91a85cf22fdbdf762e9a59d8087b32bcedb7e085
This commit is contained in:
Dimitri Savineau
2015-06-17 15:36:59 -04:00
committed by Dimitri Savineau
parent ee2a116ad8
commit 360ddfaae8
2 changed files with 22 additions and 13 deletions

View File

@@ -27,6 +27,10 @@
# (optional) Nova's console type (spice or novnc) # (optional) Nova's console type (spice or novnc)
# Defaults to 'novnc' # Defaults to 'novnc'
# #
# [*protocol*]
# (optional) Nova's console protocol.
# Defaults to 'http'
#
# [*novnc_port*] # [*novnc_port*]
# (optional) TCP port to bind Nova novnc service. # (optional) TCP port to bind Nova novnc service.
# Defaults to '6080' # Defaults to '6080'
@@ -43,6 +47,7 @@
class cloud::compute::consoleproxy( class cloud::compute::consoleproxy(
$api_eth = '127.0.0.1', $api_eth = '127.0.0.1',
$console = 'novnc', $console = 'novnc',
$protocol = 'http',
$novnc_port = '6080', $novnc_port = '6080',
$spice_port = '6082', $spice_port = '6082',
$firewall_settings = {}, $firewall_settings = {},
@@ -53,23 +58,26 @@ class cloud::compute::consoleproxy(
case $console { case $console {
'spice': { 'spice': {
$port = $spice_port $port = $spice_port
$proxy = 'spicehtml5proxy' class { 'nova::spicehtml5proxy':
enabled => true,
host => $api_eth,
port => $port
}
} }
'novnc': { 'novnc': {
$port = $novnc_port $port = $novnc_port
$proxy = 'vncproxy' class { 'nova::vncproxy':
enabled => true,
host => $api_eth,
port => $port,
vncproxy_protocol => $protocol
}
} }
default: { default: {
fail("Unsupported console type ${console}") fail("Unsupported console type ${console}")
} }
} }
class { "nova::${proxy}":
enabled => true,
host => $api_eth,
port => $port
}
if $::cloud::manage_firewall { if $::cloud::manage_firewall {
cloud::firewall::rule{ "100 allow ${console} access": cloud::firewall::rule{ "100 allow ${console} access":
port => $port, port => $port,

View File

@@ -83,7 +83,8 @@ describe 'cloud::compute::consoleproxy' do
is_expected.to contain_class('nova::vncproxy').with( is_expected.to contain_class('nova::vncproxy').with(
:enabled => true, :enabled => true,
:host => '10.0.0.1', :host => '10.0.0.1',
:port => '6080' :port => '6080',
:vncproxy_protocol => 'http'
) )
end end