From: Dan Prince Date: Thu, 29 Aug 2013 14:41:48 +0000 (-0400) Subject: Add default auth_uri setting for auth token. X-Git-Tag: 3.0.0-rc2~12^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=17711d8230432a883753b2f2ebece4fb1cf7ab16;p=puppet-modules%2Fpuppet-ceilometer.git Add default auth_uri setting for auth token. The latest keystoneclient code now gives a Warning if auth_uri isn't explicitly specified. Change-Id: I0feb52f7a9140ea750254f80b6a3e6855b25f1d3 --- diff --git a/manifests/api.pp b/manifests/api.pp index 786fa1d..8b76bcf 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -36,6 +36,7 @@ class ceilometer::api ( $keystone_user = 'ceilometer', $keystone_tenant = 'services', $keystone_password = false, + $keystone_auth_uri = false, ) { include ceilometer::params @@ -88,4 +89,14 @@ class ceilometer::api ( } } + if $keystone_auth_uri { + ceilometer_config { + 'keystone_authtoken/auth_uri': value => $keystone_auth_uri; + } + } else { + ceilometer_config { + 'keystone_authtoken/auth_uri': value => "${keystone_protocol}://${keystone_host}:5000/"; + } + } + } diff --git a/spec/classes/ceilometer_api_spec.rb b/spec/classes/ceilometer_api_spec.rb index 072d4bf..3d659f6 100644 --- a/spec/classes/ceilometer_api_spec.rb +++ b/spec/classes/ceilometer_api_spec.rb @@ -53,6 +53,7 @@ describe 'ceilometer::api' do should contain_ceilometer_config('keystone_authtoken/admin_user').with_value( params[:keystone_user] ) should contain_ceilometer_config('keystone_authtoken/admin_password').with_value( params[:keystone_password] ) should contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with_ensure('absent') + should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value( params[:keystone_protocol] + "://" + params[:keystone_host] + ":5000/" ) end context 'when specifying keystone_auth_admin_prefix' do @@ -104,4 +105,19 @@ describe 'ceilometer::api' do it_configures 'ceilometer-api' end + + describe 'with custom auth_uri' do + let :facts do + { :osfamily => 'RedHat' } + end + before do + params.merge!({ + :keystone_auth_uri => 'https://foo.bar:1234/', + }) + end + it 'should configure custom auth_uri correctly' do + should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value( 'https://foo.bar:1234/' ) + end + end + end