aboutsummaryrefslogtreecommitdiffstats
path: root/modules/openldap/lib/puppet/parser/functions/get_ldap_servers.rb
blob: ce9ec1b144ab9790d96620b5c6da3171e2b68b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# return a list of all ldap servers declared
module Puppet::Parser::Functions
    newfunction(:get_ldap_servers, :type => :rvalue) do |args| 
        Puppet::Parser::Functions.autoloader.loadall
        res = ["master"]
 
        function_list_exported_ressources(['Openldap::Exported_slave']).each { |i| 
              res << "slave-#{i}" 
        }
        res.map! { |x| "ldap-#{x}." + lookupvar("domain") }
        return res.join(" ")
    end
end