diff --git a/README.md b/README.md index e2b07d240482d84a86c5d69379c02387623f0937..b763339901a116f521538be648adb41f35d6f73c 100644 --- a/README.md +++ b/README.md @@ -374,8 +374,8 @@ Password for the `identity` account. Required. Unless overridden in another section, the dn from which all searches will start from. Required. ##### `server` -Hostname of IP address of the LDAP server. Note that this needs to match the name(s) in the LDAP server -certificate, if you're using ldaps. Default: `localhost` +Array of hostnames or IP addresses of the LDAP server(s). Note that this needs to match the name(s) in the LDAP +server certificate, if you're using ldaps. Default: [`localhost`] ##### `port` Port to connect to the LDAP server on. Default: `389` diff --git a/manifests/ldap.pp b/manifests/ldap.pp index 0c284dd9acbd0562d5dcfe19e52d907d029f26d5..b77d0517f5325aa7f814ed8c1d0fbca3e8b19498 100644 --- a/manifests/ldap.pp +++ b/manifests/ldap.pp @@ -3,7 +3,7 @@ define freeradius::ldap ( $identity, $password, $basedn, - $server = 'localhost', + $server = ['localhost'], $port = 389, $uses = 0, $idle = 60, diff --git a/templates/ldap.fr2.erb b/templates/ldap.fr2.erb index 4030043c3a138721a2ee6a29b6d9c39f783aac33..acea08ad739cbccca37a666d8e948cae511a5e9a 100644 --- a/templates/ldap.fr2.erb +++ b/templates/ldap.fr2.erb @@ -30,7 +30,11 @@ ldap <%= @name %> { # # Note that this needs to match the name in the LDAP # server certificate, if you're using ldaps. - server = "<%= @server %>" + # + # + +<% @server.each do |srv| -%> server = "<%= srv %>" +<% end -%> identity = "<%= @identity %>" password = <%= @password %> basedn = "<%= @basedn %>" diff --git a/templates/ldap.fr3.erb b/templates/ldap.fr3.erb index e42ef9200fa0bca0d9c9bbecacfaee941391da62..5db9b6f3ccb6c0e1c7f7c5fad5e6f8db5ea722df 100644 --- a/templates/ldap.fr3.erb +++ b/templates/ldap.fr3.erb @@ -16,7 +16,10 @@ ldap <%= @name %> { # - ldaps:// (LDAP over SSL) # - ldapi:// (LDAP over Unix socket) # - ldapc:// (Connectionless LDAP) - server = '<%= @server %>' + +<% @server.each do |srv| -%> server = '<%= srv %>' +<% end -%> +# server = '<%= @server %>' # server = 'ldap.rrdns.example.org' # server = 'ldap.rrdns.example.org'