From f8eea90cd9f1652ba927bfcc9bf8234af8983c11 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 2 Jan 2014 15:50:34 +0100 Subject: [PATCH] Add API binding options Ceilometer is able to bind API server to both an IP address and a port. This patch aims to add support for both configuration flags. Change-Id: I83164a925cf115d091cb04d14922ee7bbdd0ac63 Signed-off-by: Emilien Macchi --- manifests/api.pp | 13 +++++++++++++ spec/classes/ceilometer_api_spec.rb | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/manifests/api.pp b/manifests/api.pp index 8b76bcf..92406a8 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -27,6 +27,15 @@ # [*keystone_password*] password to authenticate with # Mandatory. # +# [*host*] +# (optional) The ceilometer api bind address +# Defaults to 0.0.0.0 +# +# [*port*] +# (optional) The ceilometer api port +# Defaults to 8777 +# + class ceilometer::api ( $enabled = true, $keystone_host = '127.0.0.1', @@ -37,6 +46,8 @@ class ceilometer::api ( $keystone_tenant = 'services', $keystone_password = false, $keystone_auth_uri = false, + $host = '0.0.0.0', + $port = '8777' ) { include ceilometer::params @@ -76,6 +87,8 @@ class ceilometer::api ( 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; 'keystone_authtoken/admin_user' : value => $keystone_user; 'keystone_authtoken/admin_password' : value => $keystone_password; + 'api/host' : value => $host; + 'api/port' : value => $port; } if $keystone_auth_admin_prefix { diff --git a/spec/classes/ceilometer_api_spec.rb b/spec/classes/ceilometer_api_spec.rb index dff13d0..546f92f 100644 --- a/spec/classes/ceilometer_api_spec.rb +++ b/spec/classes/ceilometer_api_spec.rb @@ -13,7 +13,9 @@ describe 'ceilometer::api' do :keystone_protocol => 'http', :keystone_user => 'ceilometer', :keystone_password => 'ceilometer-passw0rd', - :keystone_tenant => 'services' + :keystone_tenant => 'services', + :host => '0.0.0.0', + :port => '8777' } end @@ -54,6 +56,8 @@ describe 'ceilometer::api' do 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/" ) + should contain_ceilometer_config('api/host').with_value( params[:host] ) + should contain_ceilometer_config('api/port').with_value( params[:port] ) end context 'when specifying keystone_auth_admin_prefix' do -- 2.45.2