diff --git a/manifests/api.pp b/manifests/api.pp index 03551980..c68151d3 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -44,6 +44,10 @@ # HTTPProxyToWSGI middleware. # Defaults to $::os_service_default. # +# [*gnocchi_external_project_owner*] +# (optional) Gnocchi external project owner (usually Ceilometer project name) +# Defaults to 'services' +# class aodh::api ( $manage_service = true, $enabled = true, @@ -54,6 +58,7 @@ class aodh::api ( $sync_db = false, $auth_strategy = 'keystone', $enable_proxy_headers_parsing = $::os_service_default, + $gnocchi_external_project_owner = 'services', ) inherits aodh::params { @@ -109,8 +114,9 @@ as a standalone service, or httpd for being run by a httpd server") } aodh_config { - 'api/host': value => $host; - 'api/port': value => $port; + 'api/gnocchi_external_project_owner': value => $gnocchi_external_project_owner; + 'api/host': value => $host; + 'api/port': value => $port; } oslo::middleware { 'aodh_config': diff --git a/spec/classes/aodh_api_spec.rb b/spec/classes/aodh_api_spec.rb index e753c122..446bdbf3 100644 --- a/spec/classes/aodh_api_spec.rb +++ b/spec/classes/aodh_api_spec.rb @@ -36,6 +36,7 @@ describe 'aodh::api' do it 'configures api' do is_expected.to contain_aodh_config('api/host').with_value( params[:host] ) is_expected.to contain_aodh_config('api/port').with_value( params[:port] ) + is_expected.to contain_aodh_config('api/gnocchi_external_project_owner').with_value( 'services' ) is_expected.to contain_aodh_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>') end @@ -76,6 +77,13 @@ describe 'aodh::api' do it { is_expected.to contain_aodh_config('oslo_middleware/enable_proxy_headers_parsing').with_value(true) } end + context 'with gnocchi_external_project_owner' do + before do + params.merge!({:gnocchi_external_project_owner => 'gnocchi-project' }) + end + + it { is_expected.to contain_aodh_config('api/gnocchi_external_project_owner').with_value('gnocchi-project') } + end context 'with disabled service managing' do before do params.merge!({