steffen: server/perl-kolab/Kolab-Conf Conf.pm,1.27,1.28

cvs at intevation.de cvs at intevation.de
Wed Jul 14 23:25:01 CEST 2004


Author: steffen

Update of /kolabrepository/server/perl-kolab/Kolab-Conf
In directory doto:/tmp/cvs-serv17564/Kolab-Conf

Modified Files:
	Conf.pm 
Log Message:
steps towards replicated ldap db

Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab-Conf/Conf.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- Conf.pm	14 Jul 2004 14:36:19 -0000	1.27
+++ Conf.pm	14 Jul 2004 21:24:59 -0000	1.28
@@ -445,17 +445,25 @@
         exit(1);
     }
 
-    my @kh;
-    if( ref $Kolab::config{'kolabhost'} eq 'ARRAY' ) {
-      @kh = @{$Kolab::config{'kolabhost'}};
+    if( $Kolab::config{'is_master'} eq "true" ) {
+      # Master setup
+      my @kh;
+      if( ref $Kolab::config{'kolabhost'} eq 'ARRAY' ) {
+	@kh = @{$Kolab::config{'kolabhost'}};
+      } else {
+	@kh = ( $Kolab::config{'kolabhost'} );
+      }
+      for my $h ( @kh ) {
+	next if $h eq $Kolab::config{'fqhostname'};
+	print $repl "replica uri=ldaps://$h\n"
+	  ."  binddn=\"".$Kolab::config{'bind_dn'}."\"\n"
+	    ."  bindmethod=simple credentials=".$Kolab::config{'bind_pw'}."\n\n";
+      }
     } else {
-      @kh = ( $Kolab::config{'kolabhost'} );
-    }
-    for my $h ( @kh ) {
-      next if $h eq $Kolab::config{'fqhostname'};
-      print $repl "replica uri=ldaps://$h:9999\n"
-        ."  binddn=\"cn=replicator\"\n"
-	."  bindmethod=simple credentials=secret\n\n";
+      # Slave setup
+      # Output an update dn statement instead
+      print $repl "updatedn ".$Kolab::config{'bind_dn'}."\n";
+      print $repl "updateref ".$Kolab::config{'ldap_master_uri'}."\n";
     }
 
     $repl->close;





More information about the commits mailing list