Skip to content

Commit

Permalink
Merge pull request redhat-openstack#198 from nightfly19/master
Browse files Browse the repository at this point in the history
Fix rabbitmq.config.erb to allow ldap auth without configuring stomp
  • Loading branch information
Ashley Penney committed Jun 5, 2014
2 parents ae31e90 + d0f4cae commit 04a5f9a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,30 @@
end
end

describe 'configuring ldap authentication' do
let :params do
{ :config_stomp => false,
:ldap_auth => true,
:ldap_server => 'ldap.example.com',
:ldap_user_dn_pattern => 'ou=users,dc=example,dc=com',
:ldap_use_ssl => false,
:ldap_port => '389',
:ldap_log => true
}
end

it { should contain_rabbitmq_plugin('rabbitmq_auth_backend_ldap') }

it 'should contain ldap parameters' do
verify_contents(subject, 'rabbitmq.config',
['[', ' {rabbit, [', ' {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},', ' ]}',
' {rabbitmq_auth_backend_ldap, [', ' {other_bind, anon},',
' {servers, ["ldap.example.com"]},',
' {user_dn_pattern, "ou=users,dc=example,dc=com"},', ' {use_ssl, false},',
' {port, 389},', ' {log, true}'])
end
end

describe 'default_user and default_pass set' do
let(:params) {{ :default_user => 'foo', :default_pass => 'bar' }}
it 'should set default_user and default_pass to specified values' do
Expand Down
2 changes: 1 addition & 1 deletion templates/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
{ssl_listeners, [<%= @ssl_stomp_port %>]}
<%- end -%>
]}
<% end -%>
<%- if @ldap_auth -%>,
% Configure the LDAP authentication plugin
{rabbitmq_auth_backend_ldap, [
Expand All @@ -47,7 +48,6 @@
{port, <%= @ldap_port %>},
{log, <%= @ldap_log %>}
]}
<% end -%>
<%- end -%>
].
% EOF

0 comments on commit 04a5f9a

Please sign in to comment.