Allow rabbit mq kombu ssl configuration

Add the rest of the kombu ssl configuration options.

Change-Id: I71e50e405d6447229bce23e1b1db67fdfad316a8
Partial-Bug: 1464706
This commit is contained in:
Mark Vanderwiel 2015-06-16 10:52:18 -05:00
parent 090a291942
commit 62f41a402f
3 changed files with 54 additions and 29 deletions

View File

@ -18,5 +18,5 @@ recipe 'openstack-orchestration::identity_registration', 'Registers Heat service
supports os
end
depends 'openstack-common', '>= 11.2.0'
depends 'openstack-common', '>= 11.4.0'
depends 'openstack-identity', '>= 11.0.0'

View File

@ -435,15 +435,35 @@ shared_examples 'expects to create heat conf' do
end
end
it 'does not have kombu ssl version set' do
expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^kombu_ssl_version=TLSv1.2$/)
it 'does not have ssl config set' do
[/^rabbit_use_ssl=/,
/^kombu_ssl_version=/,
/^kombu_ssl_keyfile=/,
/^kombu_ssl_certfile=/,
/^kombu_ssl_ca_certs=/,
/^kombu_reconnect_delay=/,
/^kombu_reconnect_timeout=/].each do |line|
expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line)
end
end
it 'sets kombu ssl version' do
it 'sets ssl config' do
node.set['openstack']['mq']['orchestration']['rabbit']['use_ssl'] = true
node.set['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_version'] = 'TLSv1.2'
expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^kombu_ssl_version=TLSv1.2$/)
node.set['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_keyfile'] = 'keyfile'
node.set['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_certfile'] = 'certfile'
node.set['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_ca_certs'] = 'certsfile'
node.set['openstack']['mq']['orchestration']['rabbit']['kombu_reconnect_delay'] = 123.123
node.set['openstack']['mq']['orchestration']['rabbit']['kombu_reconnect_timeout'] = 123
[/^rabbit_use_ssl=true/,
/^kombu_ssl_version=TLSv1.2$/,
/^kombu_ssl_keyfile=keyfile$/,
/^kombu_ssl_certfile=certfile$/,
/^kombu_ssl_ca_certs=certsfile$/,
/^kombu_reconnect_delay=123.123$/,
/^kombu_reconnect_timeout=123$/].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line)
end
end
it 'has the default rabbit_retry_interval set' do

View File

@ -1361,28 +1361,36 @@ amqp_auto_delete=<%= node['openstack']['mq']['orchestration']['auto_delete'] %>
# Size of RPC connection pool. (integer value)
rpc_conn_pool_size=<%= node["openstack"]["orchestration"]["rpc_conn_pool_size"] %>
# SSL version to use (valid only if SSL enabled). Valid values are TLSv1 and
# SSLv23. SSLv2, SSLv3, TLSv1_1, and TLSv1_2 may be available on some
# distributions. (string value)
# Deprecated group/name - [DEFAULT]/kombu_ssl_version
<% if node["openstack"]["mq"]["orchestration"]["rabbit"]["use_ssl"] && node["openstack"]["mq"]["orchestration"]["rabbit"]["kombu_ssl_version"] %>
kombu_ssl_version=<%= node["openstack"]["mq"]["orchestration"]["rabbit"]["kombu_ssl_version"] %>
<% if node['openstack']['mq']['orchestration']['rabbit']['use_ssl'] -%>
# Connect over SSL for RabbitMQ. (boolean value)
rabbit_use_ssl=true
<% if node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_version'] -%>
# SSL version to use (valid only if SSL enabled). valid values
# are TLSv1 and SSLv23. SSLv2 and SSLv3 may be available on
# some distributions. (string value)
kombu_ssl_version=<%= node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_version'] %>
<% end -%>
<% if node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_keyfile'] -%>
# SSL key file (valid only if SSL enabled)
kombu_ssl_keyfile=<%= node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_keyfile'] %>
<% end -%>
<% if node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_certfile'] -%>
# SSL cert file (valid only if SSL enabled)
kombu_ssl_certfile=<%= node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_certfile'] %>
<% end -%>
<% if node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_ca_certs'] -%>
# SSL certification authority file (valid only if SSL enabled)
kombu_ssl_ca_certs=<%= node['openstack']['mq']['orchestration']['rabbit']['kombu_ssl_ca_certs'] %>
<% end -%>
# How long to wait before reconnecting in response to an AMQP consumer cancel notification
kombu_reconnect_delay=<%= node['openstack']['mq']['orchestration']['rabbit']['kombu_reconnect_delay'] %>
# How long to wait before considering a reconnect attempt to have failed.
# This value should not be longer than rpc_response_timeout
kombu_reconnect_timeout=<%= node['openstack']['mq']['orchestration']['rabbit']['kombu_reconnect_timeout'] %>
<% end -%>
# SSL key file (valid only if SSL enabled). (string value)
#kombu_ssl_keyfile=
# SSL cert file (valid only if SSL enabled). (string value)
#kombu_ssl_certfile=
# SSL certification authority file (valid only if SSL
# enabled). (string value)
#kombu_ssl_ca_certs=
# How long to wait before reconnecting in response to an AMQP
# consumer cancel notification. (floating point value)
#kombu_reconnect_delay=1.0
# RabbitMQ HA cluster host:port pairs (list value)
<% if node["openstack"]["mq"]["orchestration"]["rabbit"]["ha"] -%>
rabbit_hosts=<%= @rabbit_hosts %>
@ -1406,9 +1414,6 @@ rabbit_port=<%= node["openstack"]["mq"]["orchestration"]["rabbit"]["port"] %>
rabbit_ha_queues=False
<% end -%>
# Connect over SSL for RabbitMQ. (boolean value)
rabbit_use_ssl=<%= node["openstack"]["mq"]["orchestration"]["rabbit"]["use_ssl"] %>
# The RabbitMQ userid. (string value)
rabbit_userid=<%= node["openstack"]["mq"]["orchestration"]["rabbit"]["userid"] %>