From 4c1bbf6ea85763084fc45d56c5c50ea02ad5ac32 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 8 Jan 2014 11:48:08 +0100 Subject: [PATCH] Remove hard-coded API ports to use params instead Signed-off-by: Emilien Macchi --- manifests/compute/controller.pp | 12 ++++++++---- manifests/identity.pp | 3 ++- manifests/orchestration/engine.pp | 18 ++++++++++-------- .../privatecloud_compute_controller_spec.rb | 4 ++++ spec/classes/privatecloud_identity_spec.rb | 1 + .../privatecloud_orchestration_engine_spec.rb | 12 +++++++----- 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/manifests/compute/controller.pp b/manifests/compute/controller.pp index 2102bc13..bd8e07c6 100644 --- a/manifests/compute/controller.pp +++ b/manifests/compute/controller.pp @@ -21,6 +21,10 @@ class privatecloud::compute::controller( $ks_nova_password = $os_params::ks_nova_password, $neutron_metadata_proxy_shared_secret = $os_params::neutron_metadata_proxy_shared_secret, $api_eth = $os_params::api_eth, + $spice_port = $os_params::spice_port, + $ks_nova_public_port = $os_params::ks_nova_public_port, + $ks_ec2_public_port = $os_params::ks_ec2_public_port, + $ks_metadata_public_port = $os_params::ks_metadata_public_port ){ include 'privatecloud::compute' @@ -48,7 +52,7 @@ class privatecloud::compute::controller( listening_service => 'ec2_api_cluster', server_names => $::hostname, ipaddresses => $api_eth, - ports => '8773', + ports => $ks_ec2_public_port, options => 'check inter 2000 rise 2 fall 5' } @@ -56,7 +60,7 @@ class privatecloud::compute::controller( listening_service => 'nova_api_cluster', server_names => $::hostname, ipaddresses => $api_eth, - ports => '8774', + ports => $ks_nova_public_port, options => 'check inter 2000 rise 2 fall 5' } @@ -64,7 +68,7 @@ class privatecloud::compute::controller( listening_service => 'metadata_api_cluster', server_names => $::hostname, ipaddresses => $api_eth, - ports => '8775', + ports => $ks_metadata_public_port, options => 'check inter 2000 rise 2 fall 5' } @@ -72,7 +76,7 @@ class privatecloud::compute::controller( listening_service => 'spice_cluster', server_names => $::hostname, ipaddresses => $api_eth, - ports => '6082', + ports => $spice_port, options => 'check inter 2000 rise 2 fall 5' } diff --git a/manifests/identity.pp b/manifests/identity.pp index 9fc0a3f5..9a51f003 100644 --- a/manifests/identity.pp +++ b/manifests/identity.pp @@ -301,6 +301,7 @@ class privatecloud::identity ( $ks_nova_password = $os_params::ks_nova_password, $ks_nova_public_host = $os_params::ks_nova_public_host, $ks_nova_public_proto = $os_params::ks_nova_public_proto, + $ks_nova_public_port = $os_params::ks_nova_public_port, $ks_swift_dispersion_password = $os_params::ks_swift_dispersion_password, $ks_swift_internal_host = $os_params::ks_swift_internal_host, $ks_swift_internal_port = $os_params::ks_swift_internal_port, @@ -321,7 +322,7 @@ class privatecloud::identity ( class { 'keystone': enabled => false, admin_token => $ks_admin_token, - compute_port => '8774', + compute_port => $ks_nova_public_port, debug => $debug, idle_timeout => 60, log_facility => 'LOG_LOCAL0', diff --git a/manifests/orchestration/engine.pp b/manifests/orchestration/engine.pp index b6deaa30..637202a8 100644 --- a/manifests/orchestration/engine.pp +++ b/manifests/orchestration/engine.pp @@ -18,11 +18,13 @@ # class privatecloud::orchestration::engine( - $enabled = true, - $ks_heat_public_host = $os_params::ks_heat_public_host, - $ks_heat_public_proto = $os_params::ks_heat_public_proto, - $ks_heat_password = $os_params::ks_heat_password, - $auth_encryption_key = $os_params::heat_auth_encryption_key + $enabled = true, + $ks_heat_public_host = $os_params::ks_heat_public_host, + $ks_heat_public_proto = $os_params::ks_heat_public_proto, + $ks_heat_password = $os_params::ks_heat_password, + $ks_heat_cfn_public_port = $os_params::ks_heat_cfn_public_port, + $ks_heat_cloudwatch_public_port = $os_params::ks_heat_cloudwatch_public_port, + $auth_encryption_key = $os_params::heat_auth_encryption_key ) { include 'privatecloud::orchestration' @@ -30,9 +32,9 @@ class privatecloud::orchestration::engine( class { 'heat::engine': enabled => $enabled, auth_encryption_key => $auth_encryption_key, - heat_metadata_server_url => "${ks_heat_public_proto}://${ks_heat_public_host}:8000", - heat_waitcondition_server_url => "${ks_heat_public_proto}://${ks_heat_public_host}:8000/v1/waitcondition", - heat_watch_server_url => "${ks_heat_public_proto}://${ks_heat_public_host}:8003" + heat_metadata_server_url => "${ks_heat_public_proto}://${ks_heat_public_host}:${ks_heat_cfn_public_port}", + heat_waitcondition_server_url => "${ks_heat_public_proto}://${ks_heat_public_host}:${ks_heat_cfn_public_port}/v1/waitcondition", + heat_watch_server_url => "${ks_heat_public_proto}://${ks_heat_public_host}:${ks_heat_cloudwatch_public_port}" } } diff --git a/spec/classes/privatecloud_compute_controller_spec.rb b/spec/classes/privatecloud_compute_controller_spec.rb index aa85c7bc..5d4a5fed 100644 --- a/spec/classes/privatecloud_compute_controller_spec.rb +++ b/spec/classes/privatecloud_compute_controller_spec.rb @@ -39,6 +39,10 @@ describe 'privatecloud::compute::controller' do { :ks_keystone_internal_host => '10.0.0.1', :ks_nova_password => 'secrete', :api_eth => '10.0.0.1', + :spice_port => '6082', + :ks_ec2_public_port => '8773', + :ks_nova_public_port => '8774', + :ks_metadata_public_port => '8775', :neutron_metadata_proxy_shared_secret => 'secrete' } end diff --git a/spec/classes/privatecloud_identity_spec.rb b/spec/classes/privatecloud_identity_spec.rb index 8766a6c9..077fdd4b 100644 --- a/spec/classes/privatecloud_identity_spec.rb +++ b/spec/classes/privatecloud_identity_spec.rb @@ -71,6 +71,7 @@ describe 'privatecloud::identity' do :ks_nova_password => 'secrete', :ks_nova_public_host => '10.0.0.1', :ks_nova_public_proto => 'http', + :ks_nova_public_port => '8774', :ks_swift_dispersion_password => 'secrete', :ks_swift_internal_host => '10.0.0.1', :ks_swift_internal_port => '8080', diff --git a/spec/classes/privatecloud_orchestration_engine_spec.rb b/spec/classes/privatecloud_orchestration_engine_spec.rb index 58dc63f4..3a23b83c 100644 --- a/spec/classes/privatecloud_orchestration_engine_spec.rb +++ b/spec/classes/privatecloud_orchestration_engine_spec.rb @@ -43,11 +43,13 @@ describe 'privatecloud::orchestration::engine' do end let :params do - { :enabled => true, - :auth_encryption_key => 'secrete', - :ks_heat_public_host => '10.0.0.1', - :ks_heat_public_proto => 'http', - :ks_heat_password => 'secrete' } + { :enabled => true, + :auth_encryption_key => 'secrete', + :ks_heat_public_host => '10.0.0.1', + :ks_heat_public_proto => 'http', + :ks_heat_cfn_public_port => '8000', + :ks_heat_cloudwatch_public_port => '8003', + :ks_heat_password => 'secrete' } end it 'configure heat common' do