Skip to content

Commit

Permalink
Make LDAP section more configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
voroniys committed Feb 6, 2015
1 parent 654f343 commit 35fd70e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
$ldap_auth = $rabbitmq::params::ldap_auth,
$ldap_server = $rabbitmq::params::ldap_server,
$ldap_user_dn_pattern = $rabbitmq::params::ldap_user_dn_pattern,
$ldap_other_bind = $rabbitmq::params::ldap_other_bind,
$ldap_use_ssl = $rabbitmq::params::ldap_use_ssl,
$ldap_port = $rabbitmq::params::ldap_port,
$ldap_log = $rabbitmq::params::ldap_log,
$ldap_config_variables = $rabbitmq::params::ldap_config_variables,
$stomp_port = $rabbitmq::params::stomp_port,
$version = $rabbitmq::params::version,
$wipe_db_on_cookie_change = $rabbitmq::params::wipe_db_on_cookie_change,
Expand Down Expand Up @@ -103,6 +105,8 @@
validate_bool($ldap_auth)
validate_string($ldap_server)
validate_string($ldap_user_dn_pattern)
validate_string($ldap_other_bind)
validate_hash($ldap_config_variables)
validate_bool($ldap_use_ssl)
validate_re($ldap_port, '\d+')
validate_bool($ldap_log)
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@
$ldap_auth = false
$ldap_server = 'ldap'
$ldap_user_dn_pattern = 'cn=username,ou=People,dc=example,dc=com'
$ldap_other_bind = 'anon'
$ldap_use_ssl = false
$ldap_port = '389'
$ldap_log = false
$ldap_config_variables = {}
$stomp_port = '6163'
$wipe_db_on_cookie_change = false
$cluster_partition_handling = 'ignore'
Expand Down
7 changes: 6 additions & 1 deletion templates/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,16 @@
<%- if @ldap_auth -%>,
% Configure the LDAP authentication plugin
{rabbitmq_auth_backend_ldap, [
{other_bind, anon},
{other_bind, <%= @ldap_other_bind %>},
{servers, ["<%= @ldap_server %>"]},
{user_dn_pattern, "<%= @ldap_user_dn_pattern %>"},
{use_ssl, <%= @ldap_use_ssl %>},
{port, <%= @ldap_port %>},
<% if @ldap_config_variables -%>
<%- @ldap_config_variables.keys.sort.each do |key| -%>
{<%= key %>, <%= @ldap_config_variables[key] %>},
<%- end -%>
<%- end -%>
{log, <%= @ldap_log %>}
]}
<%- end -%>
Expand Down

0 comments on commit 35fd70e

Please sign in to comment.