Revision efe1cd5c
Added by Marc Dequènes about 15 years ago
- ID efe1cd5c890da81b4c93b1de0643ea67c5e4336d
bin/shadowwalker | ||
---|---|---|
begin
|
||
ActiveLdap::Base.setup_connection(config[:ldap])
|
||
|
||
config[:objects].each_pair do |obj_name, obj_data|
|
||
$ldapctl.load_object(obj_name, obj_data)
|
||
obj_config_dir = File.join(LdapShadows::Config::CFG_DIR, "objects")
|
||
obj_config_pattern = File.join(obj_config_dir, "**", "*.conf")
|
||
|
||
Dir.glob(obj_config_pattern).each do |f|
|
||
next if f[0..0] == "."
|
||
|
||
obj_name = File.basename(f).sub(".conf", "")
|
||
obj_config = YAML.load(IO.read(f))
|
||
obj_config.recursive_symbolize_keys!
|
||
|
||
$ldapctl.load_object(obj_name, obj_config)
|
||
end
|
||
|
||
$ldapctl.load_relations
|
||
rescue ActiveLdap::Error => e
|
||
STDERR.puts _("LDAP connection error: %s") % e.to_s
|
Also available in: Unified diff
[evol] improve config #1 (objects+relations config is separated)