Use the Common endpoint bare-metal-api-bind

Make use of the bind endpoint for ironic api conf

Change-Id: I03cac92746cc4bcb5a3d1dcb594fffd3f02318ce
Closes-Bug: #1452794
This commit is contained in:
Mark Vanderwiel 2015-05-07 10:53:24 -05:00
parent 25b19192a6
commit c4f4ae5369
3 changed files with 14 additions and 2 deletions

View File

@ -71,6 +71,7 @@ auth_uri = auth_uri_transform(identity_endpoint.to_s, node['openstack']['bare-me
identity_uri = identity_uri_transform(identity_admin_endpoint)
network_endpoint = internal_endpoint 'network-api' || {}
api_bind = internal_endpoint 'bare-metal-api-bind'
template '/etc/ironic/ironic.conf' do
source 'ironic.conf.erb'
@ -78,6 +79,8 @@ template '/etc/ironic/ironic.conf' do
group node['openstack']['bare-metal']['group']
mode 00640
variables(
api_bind_address: api_bind.host,
api_bind_port: api_bind.port,
db_connection: db_connection,
mq_service_type: mq_service_type,
mq_password: mq_password,

View File

@ -60,6 +60,15 @@ describe 'openstack-bare-metal::ironic-common' do
)
end
it 'has the default api attributes' do
[
/^host_ip=127.0.0.1$/,
/^port=6385$/
].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('api', line)
end
end
it 'has the default glance attributes' do
[
/^glance_host=127.0.0.1$/,

View File

@ -522,10 +522,10 @@ log_dir=<%= node['openstack']['bare-metal']['log_dir'] %>
#
# The listen IP for the Ironic API server. (string value)
#host_ip=0.0.0.0
host_ip=<%= @api_bind_address %>
# The port for the Ironic API server. (integer value)
#port=6385
port=<%= @api_bind_port %>
# The maximum number of items returned in a single response
# from a collection resource. (integer value)