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 }}"
- 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."
binddn="{{ bind_dn }}"
bindmethod=simple
credentials="{{ admin_password }}"
- searchbase="{{ db_suffix }}"
+ searchbase="{{ search_base }}"
type=refreshAndPersist
retry="{{ repl_retry }}"
tls_reqcert=never
binddn="{{ bind_dn }}"
bindmethod=simple
credentials="{{ admin_password }}"
- searchbase="{{ db_suffix }}"
+ searchbase="{{ search_base }}"
type=refreshAndPersist
retry="{{ repl_retry }}"
tls_reqcert=never