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