Expect this to solve openldap import bug

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-22 14:18:33 +02:00
parent a84abbdade
commit ff18c7cd73
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
6 changed files with 4 additions and 4 deletions

View File

@ -68,5 +68,5 @@ docker exec -i ldap \
-D "$LDAP_ADMIN_DN" \
-w "$LDAP_ADMIN_PASSWORD" \
-c \
-f "/tmp/ldif/data/01_rbac.ldif"
-f "/tmp/ldif/groups/01_rbac.ldif"
```

View File

@ -45,11 +45,11 @@
- name: "Import users, groups, etc. to LDAP"
shell: >
docker exec -i {{ openldap_name }} ldapadd -x -D "{{ldap.dn.administrator.data}}" -w "{{ldap.bind_credential}}" -c -f "{{openldap_ldif_docker_path}}data/{{ item | basename | regex_replace('\.j2$', '') }}"
docker exec -i {{ openldap_name }} ldapadd -x -D "{{ldap.dn.administrator.data}}" -w "{{ldap.bind_credential}}" -c -f "{{openldap_ldif_docker_path}}groups/{{ item | basename | regex_replace('\.j2$', '') }}"
register: ldapadd_result
changed_when: "'adding new entry' in ldapadd_result.stdout"
failed_when: ldapadd_result.rc not in [0, 20, 68, 65]
listen:
- "Import data LDIF files"
- "Import all LDIF files"
loop: "{{ query('fileglob', role_path ~ '/templates/ldif/data/*.j2') | sort }}"
loop: "{{ query('fileglob', role_path ~ '/templates/ldif/groups/*.j2') | sort }}"

View File

@ -12,7 +12,7 @@ openldap_ldif_host_path: "{{docker_compose.directories.volumes}}ldif/"
openldap_ldif_docker_path: "/tmp/ldif/"
openldap_ldif_types:
- configuration
- data
- groups
- schema # Don't know if this is still needed, it's now setup via tasks
openldap_name: "{{ applications | get_app_conf(application_id, 'docker.services.openldap.name', True) }}"