]> Frank Brehm's Git Trees - pixelpark/ldap-migration.git/commitdiff
Finishing Installation OpenLDAP
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 20 Oct 2020 15:14:05 +0000 (17:14 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 20 Oct 2020 15:14:05 +0000 (17:14 +0200)
roles/base/tasks/consumers.yaml
roles/base/tasks/consumers_per_db.yaml
roles/base/templates/syncrepl.ldif.j2

index 76d5a52fb42aa7700cf2a7658e946c79f29d336e..9c27fc63484e6c1fae764c2ef55176b4cfb629cb 100644 (file)
@@ -3,8 +3,8 @@
 - name: "Acticvating SyncRepl consumers for databases ..."
   include_tasks: "consumers_per_db.yaml"
   loop:
-    - '{0}config'
     - "{{ main_database_name }}"
+    - '{0}config'
   loop_control:
     loop_var: database_name
 
index e65df01bebbd7396790d05167fea7178725c2eed..d9b9f7daf2f33cf6280210ba669ed11c6dec8d90 100644 (file)
     db_suffix: "{{ ansible_local.openldap_dbs[database_name].suffix }}"
   when: database_name != '{0}config'
 
+- set_fact:
+    search_base: 'cn=schema,cn=config'
+  when: database_name == '{0}config'
+
+- set_fact:
+    search_base: "{{ db_suffix }}"
+  when: database_name != '{0}config'
+
 - set_fact:
     bind_dn: "{{ admin_bind_dn_prefix }},{{ db_suffix }}"
 
@@ -51,8 +59,8 @@
   - name: "Show content of applying SyncRepl consumers file."
     debug: msg={{ content_syncrepl_file.stdout_lines }}
 
-  # name: "Applying SyncRepl consumers file at the end ..."
-  # shell: "ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f '{{ syncrepl_file.path }}'"
+  - name: "Applying SyncRepl consumers file at the end ..."
+    shell: "ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f '{{ syncrepl_file.path }}'"
 
   rescue:
     - name: "Failing base installation of OpenLDAP server because of some errors."
index 4123c2269d5c68bd63489f10ad33146cf47358ca..2d915e00f45f97b21f406ec2f4b9ea0bc2fefab3 100644 (file)
@@ -6,7 +6,7 @@ olcSyncRepl: rid={{ rid_one }}{{ db_id_token }}
   binddn="{{ bind_dn }}"
   bindmethod=simple
   credentials="{{ admin_password }}"
-  searchbase="{{ db_suffix }}"
+  searchbase="{{ search_base }}"
   type=refreshAndPersist
   retry="{{ repl_retry }}"
   tls_reqcert=never
@@ -16,7 +16,7 @@ olcSyncRepl: rid={{ rid_two }}{{ db_id_token }}
   binddn="{{ bind_dn }}"
   bindmethod=simple
   credentials="{{ admin_password }}"
-  searchbase="{{ db_suffix }}"
+  searchbase="{{ search_base }}"
   type=refreshAndPersist
   retry="{{ repl_retry }}"
   tls_reqcert=never