diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 851a7be..468abcc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -405,8 +405,11 @@ shared_examples 'expects to create heat conf' do end describe 'has rabbit values' do - it 'has rabbit ha values' do + before do node.set['openstack']['mq']['orchestration']['service_type'] = 'rabbitmq' + end + + it 'has rabbit ha values' do node.set['openstack']['mq']['orchestration']['rabbit']['ha'] = true [ /^rabbit_hosts=1.1.1.1:5672,2.2.2.2:5672$/, @@ -415,6 +418,17 @@ shared_examples 'expects to create heat conf' do expect(chef_run).to render_file(file.name).with_content(line) end end + + it 'does not have kombu ssl version set' do + expect(chef_run).not_to render_config_file(file.name).with_section_content('DEFAULT', /^kombu_ssl_version=TLSv1.2$/) + end + + it 'sets kombu ssl version' 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('DEFAULT', /^kombu_ssl_version=TLSv1.2$/) + end end end end diff --git a/templates/default/heat.conf.erb b/templates/default/heat.conf.erb index a1b5bd6..515d4d2 100644 --- a/templates/default/heat.conf.erb +++ b/templates/default/heat.conf.erb @@ -258,6 +258,10 @@ qpid_reconnect_interval=<%= node["openstack"]["mq"]["orchestration"]["qpid"]["re <% if @mq_service_type == "rabbitmq" %> +<% 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"] %> +<% end -%> + # RabbitMQ HA cluster host:port pairs (list value) <% if node["openstack"]["mq"]["orchestration"]["rabbit"]["ha"] -%> rabbit_hosts=<%= @rabbit_hosts %>