]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Add API binding options
authorEmilien Macchi <emilien.macchi@enovance.com>
Thu, 2 Jan 2014 14:50:34 +0000 (15:50 +0100)
committerEmilien Macchi <emilien.macchi@enovance.com>
Thu, 2 Jan 2014 14:50:34 +0000 (15:50 +0100)
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 <emilien.macchi@enovance.com>
manifests/api.pp
spec/classes/ceilometer_api_spec.rb

index 8b76bcf4e940abe44f011eb19a02379791d670b6..92406a86b4ab929f313d02ab47fd6e97750dd561 100644 (file)
 #  [*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 {
index dff13d0d301135ccabe57a18bd394035ed57ea4c..546f92f91ca551699ffd45907ed0e2fd51fb1b5f 100644 (file)
@@ -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