Browse Source

update documentation

Bertrand Gouny 10 years ago
parent
commit
6e7d113899
3 changed files with 8 additions and 16 deletions
  1. 6 12
      README.md
  2. 0 2
      image/service/slapd/assets/test/add-host.sh
  3. 2 2
      test/test.bats

+ 6 - 12
README.md

@@ -111,26 +111,20 @@ Add -e USE_TLS=false to the run command :
 ### Multi master replication
 Quick example, with the default config.
 
-Create the first ldap server, save the container id in LDAP_CID and get its IP:
-
+	#Create the first ldap server, save the container id in LDAP_CID and get its IP:
 	LDAP_CID=$(docker run -h ldap.example.org -e USE_REPLICATION=true -d osixia/openldap)
 	LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
 
-Create the second ldap server, save the container id in LDAP2_CID and get its IP:
-
+	#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
 	LDAP2_CID=$(docker run -h ldap2.example.org -e USE_REPLICATION=true -d osixia/openldap)
 	LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
 
-Add the pair "ip hostname" to /etc/hosts on each containers,
-beacause ldap.example.org and ldap2.example.org are fake hostnames
-
-	docker exec $LDAP_CID /osixia/service/slapd/assets/test/add-host.sh $LDAP2_IP ldap2.example.org
-	docker exec $LDAP2_CID /osixia/service/slapd/assets/test/add-host.sh $LDAP_IP ldap.example.org
+	#Add the pair "ip hostname" to /etc/hosts on each containers,
+	#beacause ldap.example.org and ldap2.example.org are fake hostnames
 
-We reload slapd to let him take into consideration /etc/hosts changes
+	docker exec $LDAP_CID /sbin/add-host $LDAP2_IP ldap2.example.org
+	docker exec $LDAP2_CID /sbin/add-host $LDAP_IP ldap.example.org
 
-	docker exec $LDAP_CID pkill slapd
-	docker exec $LDAP2_CID pkill slapd
 
 That's it ! But a litle test to be sure :
 

+ 0 - 2
image/service/slapd/assets/test/add-host.sh

@@ -1,2 +0,0 @@
-#!/bin/bash -e
-echo $@ >> /etc/hosts

+ 2 - 2
test/test.bats

@@ -71,8 +71,8 @@ load test_helper
   run_image -h ldap.example.org -e USE_REPLICATION=true -e IS_REPLICATION_TEST=true
 
   # add route to hosts
-  docker exec $LDAP_REPL_CID /osixia/service/slapd/assets/test/add-host.sh $CONTAINER_IP ldap.example.org
-  docker exec $CONTAINER_ID /osixia/service/slapd/assets/test/add-host.sh $LDAP_REPL_IP ldap2.example.org
+  docker exec $LDAP_REPL_CID /sbin/add-host $CONTAINER_IP ldap.example.org
+  docker exec $CONTAINER_ID /sbin/add-host $LDAP_REPL_IP ldap2.example.org
 
   # wait services on both servers
   wait_service slapd