From f6164b5b2fa69b5fbf1b580c0d0cb66bd691d39f Mon Sep 17 00:00:00 2001 From: Aimon Bustardo Date: Mon, 15 Apr 2013 03:54:27 -0700 Subject: [PATCH] Add vncproxy_host option - vncproxy host variable was same as public_address. This arg is also used for API end points in keystone. In order to use different endpoint address and vncproxy listen address this arg needs to be configurable. Change-Id: I0b5278c7867f384581e93d71ae158f58529a6c10 --- manifests/controller.pp | 7 +++++++ manifests/nova/controller.pp | 10 ++++++++-- spec/classes/openstack_controller_spec.rb | 6 +++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/manifests/controller.pp b/manifests/controller.pp index 112df2a..9eabc8a 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -127,6 +127,7 @@ class openstack::controller ( $swift = false, # VNC $vnc_enabled = true, + $vncproxy_host = false, # General $verbose = 'False', # cinder @@ -151,6 +152,11 @@ class openstack::controller ( } else { $admin_address_real = $internal_address_real } + if $vncproxy_host { + $vncproxy_host_real = $vncproxy_host + } else { + $vncproxy_host_real = $public_address + } # Ensure things are run in order Class['openstack::db::mysql'] -> Class['openstack::keystone'] @@ -276,6 +282,7 @@ class openstack::controller ( glance_api_servers => $glance_api_servers, # VNC vnc_enabled => $vnc_enabled, + vncproxy_host => $vncproxy_host_real, # General verbose => $verbose, enabled => $enabled, diff --git a/manifests/nova/controller.pp b/manifests/nova/controller.pp index 19bbd2c..13efe82 100644 --- a/manifests/nova/controller.pp +++ b/manifests/nova/controller.pp @@ -60,6 +60,7 @@ class openstack::nova::controller ( $glance_api_servers = undef, # VNC $vnc_enabled = true, + $vncproxy_host = undef, # General $keystone_host = '127.0.0.1', $verbose = 'False', @@ -78,7 +79,12 @@ class openstack::nova::controller ( } else { $real_glance_api_servers = $glance_api_servers } - + if $vncproxy_host { + $vncproxy_host_real = $vncproxy_host + } else { + $vncproxy_host_real = $public_address + } + $sql_connection = $nova_db $glance_connection = $real_glance_api_servers $rabbit_connection = $internal_address @@ -204,7 +210,7 @@ class openstack::nova::controller ( if $vnc_enabled { class { 'nova::vncproxy': - host => $public_address, + host => $vncproxy_host_real, enabled => $enabled, } } diff --git a/spec/classes/openstack_controller_spec.rb b/spec/classes/openstack_controller_spec.rb index 693de3e..4a1d287 100644 --- a/spec/classes/openstack_controller_spec.rb +++ b/spec/classes/openstack_controller_spec.rb @@ -21,6 +21,7 @@ describe 'openstack::controller' do :nova_user_password => 'nova_pass', :secret_key => 'secret_key', :quantum => false, + :vncproxy_host => '10.0.0.1' } end @@ -357,7 +358,10 @@ describe 'openstack::controller' do should contain_class('nova::consoleauth').with(:enabled => true) should contain_class('nova::scheduler').with(:enabled => true) should contain_class('nova::objectstore').with(:enabled => true) - should contain_class('nova::vncproxy').with(:enabled => true) + should contain_class('nova::vncproxy').with( + :enabled => true, + :host => '10.0.0.1' + ) end it { should_not contain_nova_config('DEFAULT/auto_assign_floating_ip') } end