From 360ddfaae8d88a601420e30332a8b97bfc78fb8e Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Wed, 17 Jun 2015 15:36:59 -0400 Subject: [PATCH] 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 --- manifests/compute/consoleproxy.pp | 28 ++++++++++++------- .../cloud_compute_consoleproxy_spec.rb | 7 +++-- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/manifests/compute/consoleproxy.pp b/manifests/compute/consoleproxy.pp index 6b517f66..bfd815d1 100644 --- a/manifests/compute/consoleproxy.pp +++ b/manifests/compute/consoleproxy.pp @@ -27,6 +27,10 @@ # (optional) Nova's console type (spice or novnc) # Defaults to 'novnc' # +# [*protocol*] +# (optional) Nova's console protocol. +# Defaults to 'http' +# # [*novnc_port*] # (optional) TCP port to bind Nova novnc service. # Defaults to '6080' @@ -43,6 +47,7 @@ class cloud::compute::consoleproxy( $api_eth = '127.0.0.1', $console = 'novnc', + $protocol = 'http', $novnc_port = '6080', $spice_port = '6082', $firewall_settings = {}, @@ -52,24 +57,27 @@ class cloud::compute::consoleproxy( case $console { 'spice': { - $port = $spice_port - $proxy = 'spicehtml5proxy' + $port = $spice_port + class { 'nova::spicehtml5proxy': + enabled => true, + host => $api_eth, + port => $port + } } 'novnc': { - $port = $novnc_port - $proxy = 'vncproxy' + $port = $novnc_port + class { 'nova::vncproxy': + enabled => true, + host => $api_eth, + port => $port, + vncproxy_protocol => $protocol + } } default: { fail("Unsupported console type ${console}") } } - class { "nova::${proxy}": - enabled => true, - host => $api_eth, - port => $port - } - if $::cloud::manage_firewall { cloud::firewall::rule{ "100 allow ${console} access": port => $port, diff --git a/spec/classes/cloud_compute_consoleproxy_spec.rb b/spec/classes/cloud_compute_consoleproxy_spec.rb index 953e27c1..8856f920 100644 --- a/spec/classes/cloud_compute_consoleproxy_spec.rb +++ b/spec/classes/cloud_compute_consoleproxy_spec.rb @@ -81,9 +81,10 @@ describe 'cloud::compute::consoleproxy' do it 'configure nova-vncproxy' do is_expected.to contain_class('nova::vncproxy').with( - :enabled => true, - :host => '10.0.0.1', - :port => '6080' + :enabled => true, + :host => '10.0.0.1', + :port => '6080', + :vncproxy_protocol => 'http' ) end