diff --git a/README.md b/README.md index 000ff01..5b4d796 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,14 @@ Attributes TODO: Add DB2 support on other platforms * `openstack['telemetry']['platform']['db2_python_packages']` - Array of DB2 python packages, only available on redhat platform +The following attributes are defined in attributes/default.rb of the common cookbook, but are documented here due to their relevance: + +* `openstack['endpoints']['telemetry-api-bind']['host']` - The IP address to bind the api service to +* `openstack['endpoints']['telemetry-api-bind']['port']` - The port to bind the api service to +* `openstack['endpoints']['telemetry-api-bind']['bind_interface']` - The interface name to bind the api service to + +If the value of the 'bind_interface' attribute is non-nil, then the telemetry service will be bound to the first IP address on that interface. If the value of the 'bind_interface' attribute is nil, then the telemetry service will be bound to the IP address specifie + Testing ===== diff --git a/recipes/common.rb b/recipes/common.rb index fa4ff7e..c269d5d 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -62,6 +62,7 @@ service_tenant = node['openstack']['telemetry']['service_tenant_name'] identity_endpoint = endpoint 'identity-api' identity_admin_endpoint = endpoint 'identity-admin' image_endpoint = endpoint 'image-api' +telemetry_api_bind = endpoint 'telemetry-api-bind' auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['telemetry']['api']['auth']['version'] @@ -96,7 +97,9 @@ template node['openstack']['telemetry']['conf'] do service_pass: service_pass, service_tenant_name: service_tenant, service_user: service_user, - metering_secret: metering_secret + metering_secret: metering_secret, + api_bind_host: telemetry_api_bind.host, + api_bind_port: telemetry_api_bind.port ) end diff --git a/spec/common_spec.rb b/spec/common_spec.rb index 1e9ee00..986b54c 100644 --- a/spec/common_spec.rb +++ b/spec/common_spec.rb @@ -164,6 +164,18 @@ describe 'openstack-telemetry::common' do r = /^hypervisor_inspector = libvirt$/ expect(chef_run).to render_file(file.name).with_content(r) end + + it 'has bind_host set' do + node.set['openstack']['endpoints']['telemetry-api-bind']['host'] = '1.1.1.1' + expect(chef_run).to render_file(file.name).with_content( + /^host = 1.1.1.1$/) + end + + it 'has bind_port set' do + node.set['openstack']['endpoints']['telemetry-api-bind']['port'] = '9999' + expect(chef_run).to render_file(file.name).with_content( + /^port = 9999$/) + end end describe 'policy.json' do diff --git a/templates/default/ceilometer.conf.erb b/templates/default/ceilometer.conf.erb index d0303bb..ebfb464 100644 --- a/templates/default/ceilometer.conf.erb +++ b/templates/default/ceilometer.conf.erb @@ -1,7 +1,4 @@ [DEFAULT] -<% if node["openstack"]["telemetry"]["host"] %> -host = <%= node["openstack"]["telemetry"]["host"] %> -<% end %> os_auth_url = <%= @auth_uri %> os_tenant_name = <%= @service_tenant_name %> os_password = <%= @service_pass %> @@ -57,6 +54,10 @@ periodic_interval = <%= node["openstack"]["telemetry"]["periodic_interval"] %> [database] connection=<%= @database_connection %> +[api] +host = <%= @api_bind_host %> +port = <%= @api_bind_port %> + [keystone_authtoken] paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory auth_uri = <%= @auth_uri %>