9 lines
599 B
YAML
Raw Normal View History

2025-02-11 18:09:26 +01:00
- name: "import missing groups from {{ldif_docker_path}} to OpenLDAP"
2025-02-11 16:19:08 +01:00
shell: >
2025-02-12 12:41:13 +01:00
docker exec -i openldap {{ 'ldapmodify' if applications.ldap.openldap.modify|bool else 'ldapadd' }} -x -D "{{ldap.dn.administrator}}" -w "{{applications.ldap.administrator_database_password}}" -c -f "{{ldif_docker_path}}{{ item }}"
2025-02-11 18:09:26 +01:00
loop: "{{ ldif_files }}"
2025-02-11 16:19:08 +01:00
register: ldapadd_result
changed_when: "'adding new entry' in ldapadd_result.stdout"
# Allow return code 0 (all entries added) or 68 (entry already exists)
failed_when: ldapadd_result.rc not in [0, 68]
listen: "Import missing groups to OpenLDAP"