Skip to content

Commit

Permalink
Merge pull request redhat-openstack#241 from bogdando/fix_MODULES_1414
Browse files Browse the repository at this point in the history
Configure ssl_listener in stomp only for ssl
  • Loading branch information
hunner committed Oct 15, 2014
2 parents 42667aa + fb99957 commit 0aa5e60
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
fail('$ssl_only => true requires that $ssl => true')
}

if $config_stomp and $ssl_stomp_port and ! $ssl {
warning('$ssl_stomp_port requires that $ssl => true and will be ignored')
}

include '::rabbitmq::install'
include '::rabbitmq::config'
include '::rabbitmq::service'
Expand Down
10 changes: 9 additions & 1 deletion spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,16 @@
})
end
end
describe 'stomp when set ssl port w/o ssl enabled' do
let(:params) {{ :config_stomp => true, :stomp_port => 5679, :ssl => false, :ssl_stomp_port => 5680 }}
it 'should not configure ssl_listeners in rabbitmq.config' do
should contain_file('rabbitmq.config').without({
'content' => /rabbitmq_stomp.*ssl_listeners, \[5680\]/m,
})
end
end
describe 'stomp when set with ssl' do
let(:params) {{ :config_stomp => true, :stomp_port => 5679, :ssl_stomp_port => 5680 }}
let(:params) {{ :config_stomp => true, :stomp_port => 5679, :ssl => true, :ssl_stomp_port => 5680 }}
it 'should specify stomp port and ssl stomp port in rabbitmq.config' do
should contain_file('rabbitmq.config').with({
'content' => /rabbitmq_stomp.*tcp_listeners, \[5679\].*ssl_listeners, \[5680\]/m,
Expand Down
2 changes: 1 addition & 1 deletion templates/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
% Configure the Stomp Plugin listening port
{rabbitmq_stomp, [
{tcp_listeners, [<%= @stomp_port %>]}
<%- if @ssl_stomp_port -%>,
<%- if @ssl && @ssl_stomp_port -%>,
{ssl_listeners, [<%= @ssl_stomp_port %>]}
<%- end -%>
]}
Expand Down

0 comments on commit 0aa5e60

Please sign in to comment.