diff options
author | Michael Scherer <misc@mageia.org> | 2012-01-22 22:53:46 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-01-22 22:53:46 +0000 |
commit | db6291a361eb3f54a6d4c16b3ddc38d87c660117 (patch) | |
tree | 61cbd3c553a4d2f6fc3e72c88df6756f420008bb /modules/openldap/lib | |
parent | b837592ebb5e9082419875e36d9070ee3d48214c (diff) | |
download | puppet-db6291a361eb3f54a6d4c16b3ddc38d87c660117.tar puppet-db6291a361eb3f54a6d4c16b3ddc38d87c660117.tar.gz puppet-db6291a361eb3f54a6d4c16b3ddc38d87c660117.tar.bz2 puppet-db6291a361eb3f54a6d4c16b3ddc38d87c660117.tar.xz puppet-db6291a361eb3f54a6d4c16b3ddc38d87c660117.zip |
add the function get_ldap_servers to get all ldap servers ( and
so to automatically add any slave we add later )
Diffstat (limited to 'modules/openldap/lib')
-rw-r--r-- | modules/openldap/lib/puppet/parser/functions/get_ldap_servers.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/openldap/lib/puppet/parser/functions/get_ldap_servers.rb b/modules/openldap/lib/puppet/parser/functions/get_ldap_servers.rb new file mode 100644 index 00000000..ce9ec1b1 --- /dev/null +++ b/modules/openldap/lib/puppet/parser/functions/get_ldap_servers.rb @@ -0,0 +1,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 |