From 26b20003f3a884bd78b48cac58a8ea099a9b002f Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sat, 1 Feb 2014 15:51:47 +0100 Subject: [PATCH 1/3] Add new param to support both Glance ports Close #136 Signed-off-by: Emilien Macchi --- manifests/compute.pp | 4 +--- manifests/image.pp | 7 ++----- manifests/loadbalancer.pp | 5 ++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/manifests/compute.pp b/manifests/compute.pp index 5eafbfc7..f39180a1 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -63,9 +63,7 @@ class cloud::compute( $rabbit_hosts = $os_params::rabbit_hosts, $rabbit_password = $os_params::rabbit_password, $ks_glance_internal_host = $os_params::ks_glance_internal_host, - #TODO(Gonéri) will have to use $os_params::ks_glance_api_internal_port - # here in the future - $glance_api_port = $os_params::ks_glance_internal_port, + $glance_api_port = $os_params::ks_glance_api_internal_port, $verbose = $os_params::verbose, $debug = $os_params::debug ) { diff --git a/manifests/image.pp b/manifests/image.pp index c86b5042..5cc0f50d 100644 --- a/manifests/image.pp +++ b/manifests/image.pp @@ -66,11 +66,8 @@ class cloud::image( $glance_db_password = $os_params::glance_db_password, $ks_keystone_internal_host = $os_params::ks_keystone_internal_host, $ks_glance_internal_host = $os_params::ks_glance_internal_host, - # TODO(Gonéri) will have to use $os_params::ks_glance_api_internal_port - # here in the future - $ks_glance_api_internal_port = $os_params::ks_glance_internal_port, - # TODO(Gonéri) will have to use $os_params::ks_glance_registry_internal_port - $ks_glance_registry_internal_port = $os_params::ks_glance_internal_port, + $ks_glance_api_internal_port = $os_params::ks_glance_api_internal_port, + $ks_glance_registry_internal_port = $os_params::ks_glance_registry_internal_port, $ks_glance_password = $os_params::ks_glance_password, $rabbit_password = $os_params::rabbit_password, $rabbit_host = $os_params::rabbit_hosts[0], diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp index 04791cda..1bd86323 100644 --- a/manifests/loadbalancer.pp +++ b/manifests/loadbalancer.pp @@ -43,9 +43,8 @@ class cloud::loadbalancer( $ks_ec2_public_port = $os_params::ks_ec2_public_port, # TODO(Gonéri): will have to use os_params::ks_glance_api_public_port # here in the future - $ks_glance_api_public_port = $os_params::ks_glance_public_port, - # TODO(Gonéri) will have to use $os_params::ks_glance_registry_internal_port - $ks_glance_registry_internal_port = $os_params::ks_glance_internal_port, + $ks_glance_api_public_port = $os_params::ks_glance_api_public_port, + $ks_glance_registry_internal_port = $os_params::ks_glance_registry_internal_port, $ks_heat_public_port = $os_params::ks_heat_public_port, $ks_heat_cfn_public_port = $os_params::ks_heat_cfn_public_port, $ks_heat_cloudwatch_public_port = $os_params::ks_heat_cloudwatch_public_port, From 3b3f3115cbf16024b657946f53998432444a239b Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sun, 2 Feb 2014 11:07:29 +0100 Subject: [PATCH 2/3] Ensure port binding is correct for both API & registry - use bind_port for both services (Glance API & Registry) - Ensure we use the right port for registry connection from API service - unit tests Close #136 Signed-off-by: Emilien Macchi --- manifests/image.pp | 3 +++ spec/classes/cloud_image_spec.rb | 34 ++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/manifests/image.pp b/manifests/image.pp index 5cc0f50d..a61d0e92 100644 --- a/manifests/image.pp +++ b/manifests/image.pp @@ -85,6 +85,7 @@ class cloud::image( class { 'glance::api': sql_connection => "mysql://${encoded_glance_user}:${encoded_glance_password}@${glance_db_host}/glance", registry_host => $openstack_vip, + registry_port => $ks_glance_registry_internal_port, verbose => $verbose, debug => $debug, auth_host => $ks_keystone_internal_host, @@ -93,6 +94,7 @@ class cloud::image( keystone_user => 'glance', log_facility => 'LOG_LOCAL0', bind_host => $api_eth, + bind_port => $ks_glance_api_internal_port, use_syslog => true } @@ -106,6 +108,7 @@ class cloud::image( keystone_user => 'glance', log_facility => 'LOG_LOCAL0', bind_host => $api_eth, + bind_port => $ks_glance_registry_internal_port, use_syslog => true } diff --git a/spec/classes/cloud_image_spec.rb b/spec/classes/cloud_image_spec.rb index ad01eb94..9dce90f0 100644 --- a/spec/classes/cloud_image_spec.rb +++ b/spec/classes/cloud_image_spec.rb @@ -23,21 +23,22 @@ describe 'cloud::image' do shared_examples_for 'openstack image' do let :params do - { :glance_db_host => '10.0.0.1', - :glance_db_user => 'glance', - :glance_db_password => 'secrete', - :ks_keystone_internal_host => '10.0.0.1', - :ks_glance_internal_host => '10.0.0.1', - :openstack_vip => '10.0.0.42', - :ks_glance_api_internal_port => '9292', - :ks_glance_password => 'secrete', - :rabbit_host => '10.0.0.1', - :rabbit_password => 'secrete', - :rbd_store_user => 'glance', - :rbd_store_pool => 'images', - :debug => true, - :verbose => true, - :api_eth => '10.0.0.1' } + { :glance_db_host => '10.0.0.1', + :glance_db_user => 'glance', + :glance_db_password => 'secrete', + :ks_keystone_internal_host => '10.0.0.1', + :ks_glance_internal_host => '10.0.0.1', + :openstack_vip => '10.0.0.42', + :ks_glance_api_internal_port => '9292', + :ks_glance_registry_internal_port => '9191', + :ks_glance_password => 'secrete', + :rabbit_host => '10.0.0.1', + :rabbit_password => 'secrete', + :rbd_store_user => 'glance', + :rbd_store_pool => 'images', + :debug => true, + :verbose => true, + :api_eth => '10.0.0.1' } end it 'configure glance-api' do @@ -45,6 +46,7 @@ describe 'cloud::image' do :sql_connection => 'mysql://glance:secrete@10.0.0.1/glance', :keystone_password => 'secrete', :registry_host => '10.0.0.42', + :registry_port => '9191', :keystone_tenant => 'services', :keystone_user => 'glance', :verbose => true, @@ -52,6 +54,7 @@ describe 'cloud::image' do :auth_host => '10.0.0.1', :log_facility => 'LOG_LOCAL0', :bind_host => '10.0.0.1', + :bind_port => '9292', :use_syslog => true ) end @@ -67,6 +70,7 @@ describe 'cloud::image' do :auth_host => '10.0.0.1', :log_facility => 'LOG_LOCAL0', :bind_host => '10.0.0.1', + :bind_port => '9191', :use_syslog => true ) end From 982a167827fa8240422f5388af3ca09e5c952169 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 3 Feb 2014 09:32:50 +0100 Subject: [PATCH 3/3] identity: update glance api public port Close #136 Signed-off-by: Emilien Macchi --- manifests/identity.pp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/manifests/identity.pp b/manifests/identity.pp index d1a9da70..9ed71138 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -343,9 +343,7 @@ class cloud::identity ( $ks_glance_password = $os_params::ks_glance_password, $ks_glance_public_host = $os_params::ks_glance_public_host, $ks_glance_public_proto = $os_params::ks_glance_public_proto, - # TODO(Gonéri) will have to use os_params::ks_glance_api_public_port - # here in the future - $ks_glance_api_public_port = $os_params::ks_glance_public_port, + $ks_glance_api_public_port = $os_params::ks_glance_api_public_port, $ks_heat_admin_host = $os_params::ks_heat_admin_host, $ks_heat_internal_host = $os_params::ks_heat_internal_host, $ks_heat_password = $os_params::ks_heat_password,