diff --git a/manifests/orchestration/engine.pp b/manifests/orchestration/engine.pp index d973bd8e..952faf66 100644 --- a/manifests/orchestration/engine.pp +++ b/manifests/orchestration/engine.pp @@ -22,12 +22,14 @@ class privatecloud::orchestration::engine( $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::auth_encryption_key ) { include 'privatecloud::orchestration' 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" diff --git a/spec/classes/privatecloud_orchestration_api_spec.rb b/spec/classes/privatecloud_orchestration_api_spec.rb index eb941a2b..a8ba041f 100644 --- a/spec/classes/privatecloud_orchestration_api_spec.rb +++ b/spec/classes/privatecloud_orchestration_api_spec.rb @@ -32,6 +32,9 @@ describe 'privatecloud::orchestration::api' do ks_keystone_admin_host => '10.0.0.1', ks_keystone_admin_port => '5000', ks_keystone_admin_proto => 'http', + ks_heat_public_host => '10.0.0.1', + ks_heat_public_proto => 'http', + ks_heat_password => 'secrete', heat_db_host => '10.0.0.1', heat_db_user => 'heat', heat_db_password => 'secrete', @@ -40,9 +43,10 @@ describe 'privatecloud::orchestration::api' do end let :params do - { :ks_heat_internal_port => '80040', - :ks_heat_internal_port => '80040', - :api_eth => '10.0.0.1' } + { :ks_heat_internal_port => '8004', + :ks_heat_cfn_internal_port => '8000', + :ks_heat_cloudwatch_internal_port => '8003', + :api_eth => '10.0.0.1' } end it 'configure heat common' do @@ -57,42 +61,22 @@ describe 'privatecloud::orchestration::api' do :keystone_protocol => 'http', :keystone_password => 'secrete', :auth_uri => 'http://10.0.0.1:5000/v2.0', - :sql_connection => 'mysql://heat:secrete@10.0.0.1/heat', - :metering_secret => 'secrete' + :sql_connection => 'mysql://heat:secrete@10.0.0.1/heat' ) end - it 'configure ceilometer db' do - should contain_class('ceilometer::db').with( - :database_connection => 'mongodb://10.0.0.2/ceilometer' + it 'configure heat api' do + should contain_class('heat::api').with( + :bind_host => '10.0.0.1', + :bind_port => '8004' ) - end - - it 'configure ceilometer collector' do - should contain_class('ceilometer::collector') - end - - it 'configure ceilometer alarm evaluator' do - should contain_class('ceilometer::alarm::evaluator') - end - - it 'configure ceilometer alarm notifier' do - should contain_class('ceilometer::alarm::notifier') - end - - it 'configure ceilometer-api' do - should contain_class('ceilometer::api').with( - :keystone_password => 'secrete', - :keystone_host => '10.0.0.1', - :keystone_protocol => 'http', + should contain_class('heat::api_cfn').with( + :bind_host => '10.0.0.1', + :bind_port => '8000' ) - end - - it 'configure ceilometer-expirer' do - should contain_class('ceilometer::expirer').with( - :time_to_live => '2592000', - :minute => '0', - :hour => '0', + should contain_class('heat::api_cloudwatch').with( + :bind_host => '10.0.0.1', + :bind_port => '8003' ) end diff --git a/spec/classes/privatecloud_orchestration_engine_spec.rb b/spec/classes/privatecloud_orchestration_engine_spec.rb index e69de29b..f1c06f26 100644 --- a/spec/classes/privatecloud_orchestration_engine_spec.rb +++ b/spec/classes/privatecloud_orchestration_engine_spec.rb @@ -0,0 +1,96 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# Unit tests for privatecloud::orchestration::engine class +# + +require 'spec_helper' + +describe 'privatecloud::orchestration::engine' do + + shared_examples_for 'openstack orchestration engine' do + + let :pre_condition do + "class { 'privatecloud::orchestration': + rabbit_hosts => ['10.0.0.1'], + rabbit_password => 'secrete', + ks_keystone_internal_host => '10.0.0.1', + ks_keystone_internal_port => '5000', + ks_keystone_internal_proto => 'http', + ks_keystone_admin_host => '10.0.0.1', + ks_keystone_admin_port => '5000', + ks_keystone_admin_proto => 'http', + ks_heat_public_host => '10.0.0.1', + ks_heat_public_proto => 'http', + ks_heat_password => 'secrete', + heat_db_host => '10.0.0.1', + heat_db_user => 'heat', + heat_db_password => 'secrete', + verbose => true, + debug => true }" + 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' } + end + + it 'configure heat common' do + should contain_class('heat').with( + :verbose => true, + :debug => true, + :rabbit_userid => 'heat', + :rabbit_hosts => ['10.0.0.1'], + :rabbit_password => 'secrete', + :keystone_host => '10.0.0.1', + :keystone_port => '5000', + :keystone_protocol => 'http', + :keystone_password => 'secrete', + :auth_uri => 'http://10.0.0.1:5000/v2.0', + :sql_connection => 'mysql://heat:secrete@10.0.0.1/heat' + ) + end + + it 'configure heat engine' do + should contain_class('heat::engine').with( + :enabled => true, + :heat_metadata_server_url => 'http://10.0.0.1:8000', + :heat_waitcondition_server_url => 'http://10.0.0.1:8000/v1/waitcondition', + :heat_watch_server_url => 'http://10.0.0.1:8003' + ) + end + + end + + context 'on Debian platforms' do + let :facts do + { :osfamily => 'Debian' } + end + + it_configures 'openstack orchestration engine' + end + + context 'on RedHat platforms' do + let :facts do + { :osfamily => 'RedHat' } + end + + it_configures 'openstack orchestration engine' + end + +end